﻿using EnterpriseInformation.Common;
using EnterpriseInformation.DataModel;
using HtmlAgilityPack;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Serilog;
using Serilog.Events;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web;

namespace EnterpriseInformation.Controllers
{

    [ApiController]
    [Produces("application/json")]
    public class ApiController : Controller
    {
        public string LogTemplate
        {
            get
            {
                return "{Timestamp:yyyy-MM-dd HH:mm:ss} ["
                    + $"ApiController" + "] [{Level:u3}] {Message:lj}{NewLine}{Exception}";
            }
            set {; }

        }
        
        public ApiController()
        {
            Log.Logger = new LoggerConfiguration()
            .MinimumLevel.Information()
            .MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning)
            .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
            .MinimumLevel.Override("System", LogEventLevel.Warning)
            .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Warning)
            .Enrich.FromLogContext()
            .WriteTo.Console(outputTemplate: LogTemplate).WriteTo.RollingFile("logs/login.txt", outputTemplate: LogTemplate)
            .CreateLogger();
        }
        ///
        [Route("test")]
        public IActionResult test(bool iscache = true)
        {
            try
            {
                #region 介绍
                /*
                 * JObject
                 用于操作JSON对象
                JArray
                 用语操作JSON数组
                JValue
                 表示数组中的值
                JProperty
                 表示对象中的属性,以"key/value"形式
                JToken
                 用于存放Linq to JSON查询后的结果
                 */
                //foreach (var script in doc.DocumentNode.Descendants("script").ToArray())
                //    script.Remove();
                //foreach (var style in doc.DocumentNode.Descendants("style").ToArray())
                //    style.Remove();

                //foreach (var comment in doc.DocumentNode.SelectNodes("//comment()").ToArray())
                //    comment.Remove();//新增的代码

                //string innerText = doc.DocumentNode.InnerText;

                //https://www.cnblogs.com/browser/p/4455527.html
                //var document = new HtmlDocument { OptionAutoCloseOnEnd = true };
                //document.LoadHtml(item.content.Replace("\r", "").Replace("\n", ""));
                //HtmlNodeCollection panelBodys = document.DocumentNode.SelectNodes("//div[@class='law-title']");
                //HtmlNode panelBodys1 = document.DocumentNode.SelectSingleNode("//div[@id='law-title']");
                //doc.DocumentNode.SelectNodes("//section[@class=\"ntable ntable-list\"]/table/*/tr");
                ///选择不包含class属性的节点
                //var result = node.SelectNodes(".//span[not(@class)]");
                //选择不包含class和id属性的节点
                //var result = node.SelectNodes(".//span[not(@class) and not(@id)]");
                //选择不包含class="expire"的span
                //var result = node.SelectNodes(".//span[not(contains(@class,'expire'))]");
                //选择包含class="expire"的span
                //var result = node.SelectNodes(".//span[contains(@class,'expire')]");
                //通配符
                //可用* 表示任意节点名称，比如 SelectNodes("/channel/*/item")；
                //用 @*表示任意属性；
                //用 node() 表示任意类型的节点；
                //用 text() 表示文本类型的节点，实际上也就是表示取文本节点（元素节点下面是文本节点，文本节点下面才是文字）。
                //运算符
                //表示或。SelectNodes("//item|//channel")，选择 item 或 channel 节点。
                //所有元素 //*
                //所有的P元素 //p
                //所有的p元素的子元素  	//p/*
                //根据ID获取元素	//*[@id='foo']
                //根据Class获取元素     //*[contains(@class,'foo')] 1
                //拥有某个属性的元素 	//*[@title]
                //所有P元素的第一个子元素 	//p/*[0]
                //所有拥有子元素a的P元素   	//p[a]
                //class="foo"	//*[@class='foo']	class属性只有一个值foo
                //class="foobar foo bar"	//*[@class=' foo ']	class属性值中,foo在其他两边的值的中间
                //class="foo bar"//*[starts-with(@class,'foo ')]	class属性值中,foo在最左边
                //class="bar foo"	//*[substring(@class,string-length(@class)-3)=' foo']	class属性值中,foo在最右边,XPath1.0中没有ends-with函数,2.0有,现在浏览器实现的都是1.0
                //  1，  .//span  当前节点下的所有  //span 全局节点下的所有   span 当前节点的儿子节点（不包含儿子的儿子）   /span 当前节点平级节点
                //*[@class] 获取所有带class属性的

                #endregion


                //1，测试跳转
                //string url = "https://www.qcc.com/boss_search?key=%E6%B8%A9%E5%BB%BA%E5%8D%8E&industryInfo=&areaInfo=";
                //BackService.loadUserInfo();
                //ServiceControl serviceControl = new ServiceControl();
                //ResultModel ResultModel = serviceControl.HttpGet(url, "");
                new ServiceControl().test();
                return Content("1");

                //RedisHelpers.HashSet(string key, string field, string value, TimeSpan expires)
                string CacheValue = RedisHelpers.HashGet("test" + "key", "test");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //2，测试 doc 操作
                    HtmlDocument doc = new HtmlDocument();
                    doc.LoadHtml(System.IO.File.ReadAllText("TestHTML.HTML", Encoding.UTF8));
                    HtmlNodeCollection basicRows = doc.DocumentNode.SelectNodes("//a");
                    foreach (var item in basicRows)
                    {
                        var href = item.Attributes["href"];
                        if (href != null)
                        {
                            string hr = href.Value.Replace(".html", "");
                            item.SetAttributeValue("href", hr);
                        }

                        string onclick = item.OuterHtml;
                        if (onclick.Contains("guquan"))
                        {
                            item.SetAttributeValue("linktype", "guquan");
                        }
                        if (onclick.Contains("relatedList"))
                        {
                            item.SetAttributeValue("linktype", "relatedList");
                        }
                        MatchCollection mct = Regex.Matches(onclick, "\"[A-Za-z0-9]{32}\"");  //有问题
                        string id = mct.Count > 0 ? mct[0]?.Groups[0]?.Value : "";
                        if (!string.IsNullOrWhiteSpace(id))
                        {
                            item.SetAttributeValue("linkid", id);
                        }
                        MatchCollection mct2 = Regex.Matches(onclick, "'[A-Za-z0-9]{32}'");  //有问题
                        id = mct2.Count > 0 ? mct2[0]?.Groups[0]?.Value.Replace("'", "") : "";
                        if (!string.IsNullOrWhiteSpace(id))
                        {
                            item.SetAttributeValue("linkid", id);
                        }
                    }

                    HtmlNodeCollection basicRowspans = doc.DocumentNode.SelectNodes("//span[@class=\"watermark\"]|//span[contains(@class,\"vip\")]");
                    if (basicRowspans != null)
                    {
                        for (int i = 0; i < basicRowspans.Count; i++)
                        {
                            //basicRowspans.Remove(basicRowspans[i]);
                            basicRowspans[i].Remove();
                        }
                    }

                    HtmlNodeCollection basicRowexportTables = doc.DocumentNode.SelectNodes("//span");
                    if (basicRowexportTables != null)
                    {
                        for (int i = 0; i < basicRowexportTables.Count; i++)
                        {
                            var isok = basicRowexportTables[i]?.Attributes["onclick"]?.Value;
                            if (isok != null && isok.Contains("exportTable"))
                            {
                                //basicRowexportTables.Remove(basicRowexportTables[i]);
                                basicRowexportTables[i]?.ParentNode.Remove();
                            }
                            else if (isok != null && isok.Contains("addNotice"))
                            {
                                //doc.DocumentNode.SelectNodes("//span").Remove(basicRowexportTables[i]);
                                basicRowexportTables[i].Remove();
                            }
                        }
                    }
                    RedisHelpers.HashSet("test" + "key", "test", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                

                return Content(CacheValue);


            }
            catch (Exception ex)
            {

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #region 公司
        #region 查询  
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="key"></param>
        /// <param name="filter"></param>
        /// <param name="searchIndex"></param>
        /// <param name="p"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        [Route("/web/search")]
        public IActionResult CompanySearchList([FromQuery] string searchKey,string searchIndex,string filter, int pageIndex = 1, int pageSize = 20, bool iscache = true)
        {
            try
            {
                string Cachekey = "CompanySearchList" + searchKey +  searchIndex + pageIndex + pageSize + filter;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    JObject paramJO = new JObject();
                    paramJO.Add(new JProperty("pageIndex", pageIndex));
                    paramJO.Add(new JProperty("pageSize", pageSize));
                    paramJO.Add(new JProperty("searchKey", searchKey));
                    if (!string.IsNullOrWhiteSpace(filter))
                    {
                        paramJO.Add(new JProperty("filter", filter));
                    }
                    //List<string> param = new List<string>();
                    if (!string.IsNullOrWhiteSpace(searchIndex))
                    {
                        paramJO.Add(new JProperty("searchIndex", searchIndex));
                    }

                    string url = $"https://www.qcc.com/api/search/searchMulti";
                    ServiceControl serviceControl = new ServiceControl();
                    //ResultModel ResultModel = serviceControl.HttpPostJson(param, url);
                    ResultModel ResultModel = serviceControl.HttpPostJson(paramJO.ToString(), url);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200"))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(7, 0, 0, 0));
                    }
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);
                return Json(data);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 菜单
        #endregion

        #region  公司 - 基本信息
        #region 查查图谱 - 企业图谱
        [Route("cms_enterpriseGraph")]
        public IActionResult cms_enterpriseGraph(string KeyNo, bool iscache = true)
        {
            try
            {
                DateTime t1 = DateTime.Now;
                string Cachekey = "cms_enterpriseGraph" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/cms_enterpriseGraph?keyNo={KeyNo}";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpGet(url, KeyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                
                
                JObject data = JObject.Parse(CacheValue);
                data.Add(new JProperty("checktime", ((TimeSpan)(DateTime.Now - t1)).TotalSeconds));
                //Log.Logger.Information("Information");
                //Log.Logger.Error("Error");
                return Json(data);

               

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }
        }

        [Route("cms_personGraph")]
        public IActionResult cms_personGraph(string personid, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_personGraph" + personid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/cms_personGraph?keyNo={personid}";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    //随机获取

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, personid);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                
                JObject data = JObject.Parse(CacheValue);

                return Json(data);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }
        #endregion

        #region 查查图谱 - 企业收益股东图谱
        [Route("cms_enterpriseBeneficiaryGraph")]
        public IActionResult cms_enterpriseBeneficiaryGraph(string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_enterpriseBeneficiaryGraph" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/cms_enterpriseBeneficiaryGraph?keyNo={KeyNo}&type=1";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, KeyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                
                JObject data = JObject.Parse(CacheValue);

                return Json(data);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }
        }

        #endregion

        #region 查查图谱 - 关联方认定图谱
        [Route("cms_glfGetNodes")]
        public IActionResult cms_glfGetNodes([FromQuery] string KeyNo, string rule = "sh", bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_glfGetNodes" + KeyNo + rule;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/cms_glfGetNodes";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["status"] = -1;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }
                    JObject paramJO = new JObject();
                    List<string> param = new List<string>();

                    paramJO.Add(new JProperty("keyNo", KeyNo));
                    paramJO.Add(new JProperty("rule", rule));
                    foreach (var paramItem in paramJO.Properties())
                    {
                        param.Add(paramItem.Name + "=" + CommonClass.UrlEncode(paramItem.Value.ToString()));
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpPost(param, url);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) { RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = ResultModel.Html;
                }


                JObject data = JObject.Parse(CacheValue);

                return Json(data);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        [Route("cms_glfSearchNode")]
        public IActionResult cms_glfSearchNode([FromQuery] string KeyNo, string nodeType ,int pageIndex,string searchKey, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_glfSearchNode" + KeyNo + nodeType + pageIndex + searchKey;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/cms_glfSearchNode";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["status"] = -1;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }
                    JObject paramJO = new JObject();
                    List<string> param = new List<string>();

                    paramJO.Add(new JProperty("keyNo", KeyNo));
                    paramJO.Add(new JProperty("nodeType", nodeType));
                    paramJO.Add(new JProperty("pageIndex", pageIndex));
                    paramJO.Add(new JProperty("searchKey", searchKey));
                    foreach (var paramItem in paramJO.Properties())
                    {
                        param.Add(paramItem.Name + "=" + CommonClass.UrlEncode(paramItem.Value.ToString()));
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpPost(param, url);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                
                JObject data = JObject.Parse(CacheValue);


                return Json(data);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 查查图谱 - 关系图谱
        [Route("company_muhouAction")]
        public IActionResult company_muhouAction([FromQuery] string keyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_muhouAction" + keyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/company_muhouAction?keyNo={keyNo}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(keyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, keyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200"))
                    {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                
                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region  查查图谱 - 股权穿透图谱
        [Route("cms_newGuquanMap")]
        public IActionResult cms_newGuquanMap([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_newGuquanMap" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string url = $"https://www.qcc.com/cms_newGuquanMap?keyNo={KeyNo}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, KeyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        [Route("getOwnershipStructure")]
        public IActionResult getOwnershipStructure([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "getOwnershipStructure" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string url = $"https://www.qcc.com/api/charts/getOwnershipStructure";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    JObject paramJO = new JObject();
                    paramJO.Add(new JProperty("keyNo", KeyNo));

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpPostJson(paramJO.ToString(), url);
                      

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) { RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        [Route("getEquityInvestment")]
        public IActionResult getEquityInvestment([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "getEquityInvestment" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string url = $"https://www.qcc.com/api/charts/getEquityInvestment";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    JObject paramJO = new JObject();
                    paramJO.Add(new JProperty("keyNo", KeyNo));

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpPostJson(paramJO.ToString(), url);

                     
                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) 
                    { 
                        RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        [Route("getPersonOverview")]
        public IActionResult getPersonOverview([FromQuery] string eid, string pid, bool iscache = true)
        {
            try
            {
                string Cachekey = "getPersonOverview" + eid + pid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string url = $"https://www.qcc.com/api/charts/getPersonOverview";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(pid) && string.IsNullOrWhiteSpace(eid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    JObject paramJO = new JObject();
                    paramJO.Add(new JProperty("eid", eid));
                    paramJO.Add(new JProperty("pid", pid));

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpPostJson(paramJO.ToString(), url);


                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) { RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        [Route("getEnterpriseOverview")]
        public IActionResult getEnterpriseOverview([FromQuery] string eid, int org = 0, bool iscache = true)
        {
            try
            {
                string Cachekey = "getEnterpriseOverview" + eid + org.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string url = $"https://www.qcc.com/api/charts/getEnterpriseOverview";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(eid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    JObject paramJO = new JObject();
                    paramJO.Add(new JProperty("eid", eid));
                    paramJO.Add(new JProperty("org", org));

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpPostJson(paramJO.ToString(), url);


                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) { RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 查查图谱 - 股权结构图谱

        [Route("cms_guquanakzr")]
        public IActionResult cms_guquanakzr(string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_guquanakzr" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/cms_guquanakzr?keyNo={KeyNo}";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    ResultModel ResultModel = serviceControl.HttpGet(url, KeyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                
                JObject data = JObject.Parse(CacheValue);

                return Json(data);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }
        }

        #endregion

        #region 查查图谱 - 疑似实际控制人图谱
        [Route("cms_suspectedActual")]
        public IActionResult cms_suspectedActual([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_suspectedActual" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string url = $"https://www.qcc.com/cms_suspectedActualController?keyNo={KeyNo}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, KeyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }


                JObject data = JObject.Parse(CacheValue);

                return Json(data);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 营业执照信息           /菜单
        [Route("firm")]
        public IActionResult firm(string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "firm" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/firm/{unique}.html#base";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                    HtmlNode companytop = doc.DocumentNode.SelectSingleNode("//div[@class=\"company-header\"]/div[1]");
                    //if (companytop == null)
                    //{
                    //    companytop = doc.DocumentNode.SelectSingleNode("//div[@class=\"container p-t\"]");
                    //}

                    HtmlNodeCollection companybtoolbar = companytop?.SelectNodes(".//div[@class=\"company-toolbar\"]");
                    if (companybtoolbar != null)
                    {
                        foreach (var item in companybtoolbar)
                        {
                            item.Remove();
                        }
                    }

                    HtmlNode companytop3 = companytop?.SelectSingleNode("./div[@class=\"update-company\"] | ./div[@class=\"update-company\"] ");
                    if (companytop3 != null)
                    {
                        companytop3.Remove();
                    }
                    
                    HtmlNode dongtai4 = companytop?.SelectSingleNode(".//div[contains(@class,\"oxin-access\")]");
                    if (dongtai4 != null)
                    {
                        dongtai4.Remove();
                    }
                    HtmlNode companyvisit = companytop?.SelectSingleNode(".//div[contains(@class,\"company-visit\")]");
                    if (companyvisit != null)
                    {
                        companyvisit.Remove();
                    }
                    HtmlNode dcert = companytop?.SelectSingleNode(".//div[contains(@class,\"dcert\")]");
                    if (dcert != null)
                    {
                        dcert.Remove();
                    }
                    HtmlNodeCollection aas = companytop?.SelectNodes(".//a");
                    if (aas != null)
                    {
                        for (int i = 0; i < aas.Count; i++)
                        {
                            var onclickT = aas[i].Attributes["onclick"];
                            if (onclickT != null && onclickT.Value.Contains("getCaptcha"))
                            {
                                aas[i].Remove();
                            }
                            var href = aas[i].Attributes["href"];
                            if (href != null && href.Value.Contains("/company_cert"))
                            {
                                aas[i].Remove();
                            }
                        }
                    }
                    HtmlNode companyaction = companytop?.SelectSingleNode(".//div[contains(@class,\"company-action\")]");
                    if (companyaction != null)
                    {
                        HtmlNodeCollection aass = companyaction.SelectNodes(".//a");
                        if (aass != null)
                        {
                            for (int i = 0; i < aass.Count; i++)
                            {
                                aass[i].Remove();
                            }
                        }
                        string shuaxin = "<div>" + "重新刷新" + "</div>";
                        HtmlNode doccwsj = HtmlNode.CreateNode(shuaxin);
                        doccwsj.SetAttributeValue("class", "t2-count-active btn btn-primary m-r-xs");
                        doccwsj.SetAttributeValue("onclick", "window.location.reload()");
                        companyaction.AppendChild(doccwsj);
                    }

                    //basedetail basedetail = new basedetail();
                    //basedetail.CompanyId = unique;
                    //basedetail.UpdateTime = doc.DocumentNode.SelectSingleNode("//p[@class=\"refs\"]")?.InnerText.Trim();
                    //basedetail.CompanyName = doc.DocumentNode.SelectSingleNode("//div[@id=\"company-top\"]//div[@class=\"content\"]/div[1]/h1")?.InnerText.Trim();
                    //basedetail.CompanyIMG = doc.DocumentNode.SelectSingleNode("//div[@id=\"company-top\"]//div[@class=\"imgkuang\"]/img")?.Attributes["src"]?.Value.Trim();
                    //HtmlNodeCollection tagNodes =
                    //     doc.DocumentNode.SelectNodes("//div[@class=\"content\"]/div[contains(@class,\"row\") and contains(@class,\"tags\")]");
                    //HtmlNodeCollection childTagNodes = tagNodes?[0]?.SelectNodes("./*/text()|./*/*/text()");
                    //if (childTagNodes != null)
                    //{
                    //    foreach (HtmlNode childNoteItem in childTagNodes)
                    //    {
                    //        string tagText = childNoteItem.InnerText.Replace(" ", "").Replace("\n", "");
                    //        if (!string.IsNullOrWhiteSpace(tagText))
                    //        {
                    //            basedetail.TagList.Add(tagText);
                    //        }
                    //    }
                    //}


                    //HtmlNodeCollection basicRows = doc.DocumentNode.SelectNodes("//div[@class=\"dcontent\"]/div[@class=\"row\"]");

                    //HtmlNodeCollection phoneNodes = basicRows?[0]?.SelectNodes("./span[contains(@class,\"fc\")]/span[contains(@class,\"cvlu\")]");

                    //var phoneNodeSpan = phoneNodes?[0]?.SelectNodes("./span/text()")?.Where(p => !string.IsNullOrWhiteSpace(p.InnerText.Replace(" ", ""))).ToList();

                    //string phoneNum = string.Empty;

                    //if (phoneNodeSpan != null && phoneNodeSpan.Count > 0)
                    //{
                    //    phoneNum = phoneNodeSpan[0]?.InnerText;

                    //}
                    //else
                    //{

                    //    phoneNum = phoneNodes?[0]?.InnerText;
                    //}

                    //basedetail.PhoneNum = phoneNum?.Replace(" ", "").Trim();
                    //basedetail.WebSite = basicRows?[0]?.SelectSingleNode("./span[contains(@class,\"cvlu\")]/a")?.InnerText.Replace(" ", "").Trim();
                    //HtmlNodeCollection mailBoxNodes = basicRows?[1]?.SelectNodes("./span[contains(@class,\"fc\")]/span");
                    //HtmlNodeCollection mailBoxNode = mailBoxNodes?[1]?.SelectNodes("./a");
                    //string mailBox = string.Empty;
                    //if (mailBoxNode != null && mailBoxNode.Count > 0)
                    //{
                    //    mailBox = mailBoxNode[0]?.InnerText;

                    //}
                    //else
                    //{

                    //    mailBox = mailBoxNodes?[0]?.InnerText;
                    //}
                    //basedetail.MailBox = mailBox?.Replace(" ", "").Trim();


                    //basedetail.Address = basicRows?[1]?.SelectNodes("./span[contains(@class,\"cvlu\")]/a/text()")?[0]?.InnerText.Replace(" ", "");
                    //string intruduce = string.Empty;

                    //if (basicRows?.Count > 2)
                    //{
                    //    intruduce = basicRows?[2]?.SelectNodes("./span[contains(@class,\"introExpand\")]/text()")?[0]?.InnerText;

                    //}

                    //basedetail.Intruduce = intruduce?.Replace(" ", "").Trim();
                    /////////
                    //HtmlNodeCollection ComInfos = doc.DocumentNode.SelectNodes("//section[@id=\"Cominfo\"]//tr");
                    //basedetail.LegalRepId = ComInfos?[0]?.SelectSingleNode("./td/div[contains(@class,\"boss-td\")]//a[@class=\"bname\"]")?.Attributes["keyno"]?.Value;
                    //basedetail.LegalRepName = ComInfos?[0]?.SelectSingleNode("./td/div[contains(@class,\"boss-td\")]//h2")?.InnerText.Replace(" ", "");
                    //basedetail.LegalRepImg = ComInfos?[0]?.SelectSingleNode("./td/div[contains(@class,\"boss-td\")]//img")?.Attributes["src"]?.Value;
                    //basedetail.RegistrationStatus = ComInfos?[0]?.SelectNodes("./td")[3]?.InnerText.Replace(" ", "").Trim();
                    //basedetail.BuildDate = ComInfos?[0]?.SelectNodes("./td")[5]?.InnerText.Replace(" ", "").Trim();
                    ////
                    //basedetail.Capital = ComInfos?[1]?.SelectNodes("./td")[1]?.InnerText.Replace(" ", "").Trim();
                    //basedetail.IssuedCapital = ComInfos?[1]?.SelectNodes("./td")[3]?.InnerText.Replace(" ", "").Trim();
                    //basedetail.CheckDate = ComInfos?[1]?.SelectNodes("./td")[5]?.InnerText.Replace(" ", "").Trim();
                    ////
                    //basedetail.SocialCode = ComInfos?[2]?.SelectNodes("./td")[1]?.InnerText.Replace(" ", "").Trim();
                    //basedetail.OrganizationCode = ComInfos?[2]?.SelectNodes("./td")[3]?.InnerText.Replace(" ", "").Trim();
                    //basedetail.RegistrationCode = ComInfos?[2]?.SelectNodes("./td")[5]?.InnerText.Replace(" ", "").Trim();
                    ////
                    //basedetail.TaxpayerCode = ComInfos?[3]?.SelectNodes("./td")[1]?.InnerText.Trim();
                    //basedetail.ExportCode = ComInfos?[3]?.SelectNodes("./td")[3]?.InnerText.Trim();
                    //basedetail.IndustryCode = ComInfos?[3]?.SelectNodes("./td")[5]?.InnerText.Trim();
                    ////
                    //basedetail.EnterpriseType = ComInfos?[4]?.SelectNodes("./td")[1]?.InnerText.Trim();
                    //basedetail.OperationEnding = ComInfos?[4]?.SelectNodes("./td")[3]?.InnerText.Trim();
                    //basedetail.Authority = ComInfos?[4]?.SelectNodes("./td")[5]?.InnerText.Trim();
                    ////
                    //basedetail.StaffSize = ComInfos?[5]?.SelectNodes("./td")[1]?.InnerText.Trim();
                    //basedetail.InsuredSize = ComInfos?[5]?.SelectNodes("./td")[3]?.InnerText.Trim();
                    //basedetail.Area = ComInfos?[5]?.SelectNodes("./td")[5]?.InnerText.Trim();
                    ////
                    //basedetail.OnceName = ComInfos?[6]?.SelectNodes("./td")[1]?.InnerText.Trim();
                    //basedetail.EnglishName = ComInfos?[6]?.SelectNodes("./td")[3]?.InnerText.Trim();
                    ////
                    //basedetail.CompanyAddress = ComInfos?[7]?.SelectNodes("./td")[1]?.InnerText.Trim();
                    ////
                    //basedetail.CompanyScope = ComInfos?[8]?.SelectNodes("./td")[1]?.InnerText.Trim();
                    var vtab = doc.DocumentNode.SelectSingleNode("//div[@class=\"app-tab-nav\"]");
                    string tab = vtab?.OuterHtml;

                    var jobre = new
                    {
                        companytop = companytop?.OuterHtml,
                        tab = tab
                    };

                    string value = JsonConvert.SerializeObject(jobre);
                    if (!string.IsNullOrWhiteSpace(vtab?.InnerText))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }

        #region /  主要人员-最新公示/工商登记 mainmember       /最终受益人 beneficiary         /登记信息 registerInfo                   /变更历史 changelist
        [Route("firm_base")]
        public IActionResult firm_base(string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "firm_base" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?unique=he7910e63f79702ea812d50f082dfaec&companyname=%E9%A6%99%E6%B8%AF%E4%B8%AD%E5%A4%AE%E7%B5%90%E7%AE%97%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=base
                    //https://www.qcc.com/firm/he7910e63f79702ea812d50f082dfaec.html#base
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=美的集团股份有限公司&tab=base";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    ////主要人员 - 最新公示/工商登记   
                    string mainmember = doc.DocumentNode.SelectSingleNode("//section[@id=\"Mainmember\"]")?.OuterHtml;

                    //////最终受益人
                    string beneficiary = doc.DocumentNode.SelectSingleNode("//section[@id=\"syrlist\"]")?.OuterHtml;

                    ////登记信息
                    string registerInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"registerInfo\"]")?.OuterHtml;

                    ////变更历史
                    string changelist = doc.DocumentNode.SelectSingleNode("//section[@id=\"Changelist\"]")?.OuterHtml;

                    var objreturn = new
                    {
                        mainmember = mainmember,
                        beneficiary = beneficiary,
                        registerInfo = registerInfo,
                        changelist = changelist
                    };

                    string value = JsonConvert.SerializeObject(objreturn);
                    if (!string.IsNullOrWhiteSpace(mainmember) || !string.IsNullOrWhiteSpace(beneficiary) || !string.IsNullOrWhiteSpace(registerInfo) || !string.IsNullOrWhiteSpace(changelist))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }

        #endregion

        /// <summary>
        /// 营业执照
        /// </summary>
        /// <param name="KeyNo"></param>
        /// <returns></returns>
        [Route("Snapshoot")]
        public IActionResult Snapshoot([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "Snapshoot" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/snapshoot/{KeyNo}.html";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, KeyNo);

                    string urlSnapshoot = doc.DocumentNode.SelectSingleNode("//a[@id=\"download-snapshoot\"]")?.Attributes["href"]?.Value.Trim();

                    if (!string.IsNullOrWhiteSpace(urlSnapshoot))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", urlSnapshoot, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = urlSnapshoot;
                }

                
                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }

        #endregion

        #region 股东信息 - IPO最新公示 
        [Route("company_getinfos_ipopartners")]
        public IActionResult company_getinfos_ipopartners([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_ipopartners" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6b242b475738f45a4dd180564d029aa9&companyname=%E5%8D%8E%E4%B8%BA%E6%8A%80%E6%9C%AF%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=base&box=ipopartners
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "ipopartners";
                    string tab = "base";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText))
                    {
                         if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 股东信息 - 最新公示 
        //[Route("company_getinfos_partners")]
        //public IActionResult company_getinfos_partners([FromQuery] string unique, int p = 1, bool iscache = true)
        //{
        //    try
        //    {
        //        string Cachekey = "company_getinfos_partners" + unique;
        //        string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
        //        if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
        //        {

        //            //https://www.qcc.com/company_getinfos?unique=6b242b475738f45a4dd180564d029aa9&companyname=%E5%8D%8E%E4%B8%BA%E6%8A%80%E6%9C%AF%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=base&box=ipopartners
        //            //companyname = CommonClass.UrlEncode(companyname);
        //            string box = "partners";
        //            string tab = "base";
        //            string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

        //            JObject jobj = new JObject();
        //            jobj.Add(new JProperty("success", true));

        //            if (string.IsNullOrWhiteSpace(unique))
        //            {
        //                jobj["success"] = false;
        //                jobj.Add(new JProperty("message", "缺少参数！"));
        //                return Json(jobj);
        //            }


        //            ServiceControl serviceControl = new ServiceControl();

        //            HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
        //            if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText))
        //            {
        //                if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)) { RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0)); }
        //            }
        //            CacheValue = doc.DocumentNode.OuterHtml;
        //        }

        //        return Content(CacheValue);


        //    }
        //    catch (Exception ex)
        //    {
        //        Log.Logger.Error(ex.Message + ex.StackTrace);
        //        return Json(new { success = false, message = ex.Message + ex.StackTrace });
        //    }

        //}

        #endregion

        #region 股东信息 - 工商登记
        [Route("company_getinfos_partners")]
        public IActionResult company_getinfos_partners([FromQuery] string partnerscapi, string partnersratio,string capiUnit,bool hasIpoPartners,string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_partners" + partnerscapi + partnersratio + capiUnit + hasIpoPartners + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //touzistatus: 存续
                    //touziratio: 50%以上
                    //touzicapi: 100万以内
                    //https://www.qcc.com/company_getinfos?partnerscapi=&partnersratio=&capiUnit=万元&hasIpoPartners=true&unique=1d26828e97a53d95004d948ed1bc1753&companyname=贵人鸟股份有限公司&tab=base&box=partners&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "partners";
                    string tab = "base";
                    string url = $"https://www.qcc.com/company_getinfos?partnerscapi={partnerscapi}&partnersratio={partnersratio}&capiUnit={capiUnit}&hasIpoPartners={hasIpoPartners}&unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 个人关联企业  例如：点击 列表中人员后面-关联8家企业 
        [Route("people_relatedlist")]
        public IActionResult people_relatedlist([FromQuery] string personid,int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_relatedlist" + personid + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    string url = $"https://www.qcc.com/people_relatedlist?personid={personid}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 对外投资
        [Route("company_getinfos_touzi")]
        public IActionResult company_getinfos_touzi([FromQuery] string unique, string touziratio, string touziindustrycode, string touziprovince, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_touzi" + unique + touziratio + touziindustrycode + touziprovince + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //touzistatus: 存续
                    //touziratio: 50%以上
                    //touzicapi: 100万以内
                    //https://www.qcc.com/company_getinfos?unique=6b242b475738f45a4dd180564d029aa9&companyname=a&p=2&tab=base&box=touzi&touziratio=&touzistatus=&touzicapi=
                    //https://www.qcc.com/company_getinfos?unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=a&p=2&tab=base&box=touzi&touziratio=3&touziindustrycode=C&touziprovince=AH
                    touziratio = CommonClass.UrlEncode(touziratio);
                    touziindustrycode = CommonClass.UrlEncode(touziindustrycode);
                    touziprovince = CommonClass.UrlEncode(touziprovince);
                    string box = "touzi";
                    string tab = "base";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}&touziratio={touziratio}&touziindustrycode={touziindustrycode}&touziprovince={touziprovince}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);


            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 控制企业
        [Route("company_getinfos_holdco")]
        public IActionResult company_getinfos_holdco([FromQuery]  string holdprovince, string holdindustry, string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_holdco" + holdprovince + holdindustry + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //box: holdco
                    //holdprovince: GD
                    //holdindustry: J
                    //unique: 39f9e16a0ec03c7591cb2b721d103d32
                    //companyname: 内蒙古伊利实业集团股份有限公司
                    //p: 1
                    //https://www.qcc.com/company_getinfos?box=holdco&holdprovince=GD&holdindustry=J&unique=39f9e16a0ec03c7591cb2b721d103d32&companyname=%E5%86%85%E8%92%99%E5%8F%A4%E4%BC%8A%E5%88%A9%E5%AE%9E%E4%B8%9A%E9%9B%86%E5%9B%A2%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "holdco";
                    string url = $"https://www.qcc.com/company_getinfos?box={box}&holdprovince={holdprovince}&holdindustry={holdindustry}&unique={unique}&companyname=a&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 间接控制企业
        [Route("company_getinfos_indirectinvestment")]
        public IActionResult company_getinfos_indirectinvestment([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_indirectinvestment" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=39f9e16a0ec03c7591cb2b721d103d32&companyname=内蒙古伊利实业集团股份有限公司&p=2&tab=base&box=indirectinvestment
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "indirectinvestment";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 疑似关系-疑似竞争关联
        [Route("company_getinfos_competitorrel")]
        public IActionResult company_getinfos_competitorrel([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_competitorrel" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //unique: 39f9e16a0ec03c7591cb2b721d103d32
                    //companyname: 内蒙古伊利实业集团股份有限公司
                    //p: 2
                    //tab: base
                    //box: contactrel
                    //https://www.qcc.com/company_getinfos?unique=957be43aafff535541284d6992f1535a&companyname=内蒙古蒙牛乳业（集团）股份有限公司&p=2&tab=base&box=competitorrel
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "competitorrel";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 疑似关系-联系方式关联
        [Route("company_getinfos_contactrel")]
        public IActionResult company_getinfos_contactrel([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_contactrel" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //unique: 39f9e16a0ec03c7591cb2b721d103d32
                    //companyname: 内蒙古伊利实业集团股份有限公司
                    //p: 2
                    //tab: base
                    //box: contactrel
                    //https://www.qcc.com/company_getinfos?unique=befe52d9753b511b6aef5e33fe00f97d&companyname=大连万达集团股份有限公司&p=2&tab=base&box=contactrel
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "contactrel";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 疑似关系-合作关系关联
        [Route("company_getinfos_scextend")]
        public IActionResult company_getinfos_scextend([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_scextend" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //unique: 39f9e16a0ec03c7591cb2b721d103d32
                    //companyname: 内蒙古伊利实业集团股份有限公司
                    //p: 2
                    //tab: base
                    //box: contactrel
                    //https://www.qcc.com/company_getinfos?unique=befe52d9753b511b6aef5e33fe00f97d&companyname=大连万达集团股份有限公司&p=2&tab=base&box=scextend
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "scextend";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 分支机构
        [Route("company_getinfos_branche")]
        public IActionResult company_getinfos_branche([FromQuery] string branchestatus, string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_branche" + branchestatus + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //unique: 39f9e16a0ec03c7591cb2b721d103d32
                    //companyname: 内蒙古伊利实业集团股份有限公司
                    //p: 2
                    //tab: base
                    //box: contactrel
                    //https://www.qcc.com/company_getinfos?box=branche&branchestatus=&unique=befe52d9753b511b6aef5e33fe00f97d&companyname=大连万达集团股份有限公司&tab=base&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "branche";
                    string url = $"https://www.qcc.com/company_getinfos?box={box}&branchestatus={branchestatus}&unique={unique}&companyname=a&tab={tab}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 工商自主公示- 工商登记 
        [Route("company_getinfos_partnerscapi")]
        public IActionResult company_getinfos_partnerscapi([FromQuery] string partnerscapi, string partnersratio, string capiUnit, bool hasIpoPartners, string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_partnerscapi" + partnerscapi + partnersratio + capiUnit + hasIpoPartners + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //box: holdco
                    //holdprovince: GD
                    //holdindustry: J
                    //unique: 39f9e16a0ec03c7591cb2b721d103d32
                    //companyname: 内蒙古伊利实业集团股份有限公司
                    //p: 1
                    //https://www.qcc.com/company_getinfos?partnerscapi=500-1000万&partnersratio=&capiUnit=万元&hasIpoPartners=true&unique=957be43aafff535541284d6992f1535a&companyname=内蒙古蒙牛乳业（集团）股份有限公司&tab=base&box=partners&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "partners";
                    string url = $"https://www.qcc.com/company_getinfos?partnerscapi={partnerscapi}&partnersratio={partnersratio}&capiUnit={capiUnit}&hasIpoPartners={hasIpoPartners}&unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 工商自主公示- 股东及出资信息 
        [Route("company_getinfos_stockholders")]
        public IActionResult company_getinfos_stockholders([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_stockholders" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=cfd79eb5ab631f087ac61e5a3d963e54&companyname=%E8%B4%B5%E4%BA%BA%E9%B8%9F%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=base&box=stockholders&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "stockholders";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 工商自主公示- 行政许可
        [Route("company_getinfos_zzlicens")]
        public IActionResult company_getinfos_zzlicens([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_zzlicens" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=cfd79eb5ab631f087ac61e5a3d963e54&companyname=%E8%B4%B5%E4%BA%BA%E9%B8%9F%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=base&box=zzlicens&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "zzlicens";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {

                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 工商自主公示- 股权变更信息
        [Route("company_getinfos_stockchange")]
        public IActionResult company_getinfos_stockchange([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_stockchange" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6bc7e7ccdb755391651316a0227c059b&companyname=%E8%B4%B5%E4%BA%BA%E9%B8%9F%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=base&box=stockchange&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "stockchange";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {

                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 财务数据 - 主要指标
        [Route("company_getinfos_newindicator")]
        public IActionResult company_getinfos_newindicator([FromQuery] string unique,string year, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_newindicator" + year + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=美的集团股份有限公司&tab=base&box=newindicator&year=0
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "newindicator";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&year={year}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);

            }
            catch (Exception ex)
            {

                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 财务数据 - 利润表
        [Route("company_getinfos_newincome")]
        public IActionResult company_getinfos_newincome([FromQuery] string unique, string year, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_newincome" + year + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=美的集团股份有限公司&tab=base&box=newincome&year=0
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "newincome";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&year={year}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 财务数据 - 资产负债表
        [Route("company_getinfos_newbalance")]
        public IActionResult company_getinfos_newbalance([FromQuery] string unique, string year, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_newbalance" + year + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=美的集团股份有限公司&tab=base&box=newbalance&year=0
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "newbalance";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&year={year}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 财务数据 - 现金流量表
        [Route("company_getinfos_newcashflow")]
        public IActionResult company_getinfos_newcashflow([FromQuery] string unique, string year, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_newcashflow" + year + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=美的集团股份有限公司&tab=base&box=newcashflow&year=0
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "newcashflow"; 
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&year={year}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 财务简析
        [Route("company_financialanalysis")]
        public IActionResult company_financialanalysis([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_financialanalysis" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_financialanalysis?keyno=befe52d9753b511b6aef5e33fe00f97d
                    string url = $"https://www.qcc.com/company_financialanalysis?keyno={KeyNo}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, KeyNo);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 同业分析
        [Route("company_industryanalysis")]
        public IActionResult company_industryanalysis([FromQuery] string KeyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_industryanalysis" + KeyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_industryanalysis?keyno=befe52d9753b511b6aef5e33fe00f97d
                    string url = $"https://www.qcc.com/company_industryanalysis?keyno={KeyNo}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(KeyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, KeyNo);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 全球关联企业 - 全球股东 
        [Route("company_getinfos_overseapartner")]
        public IActionResult company_getinfos_overseapartner([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_overseapartner" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6bc7e7ccdb755391651316a0227c059b&companyname=%E8%B4%B5%E4%BA%BA%E9%B8%9F%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=base&box=overseapartner&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "overseapartner";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 全球关联企业 - 全球参控股企业 
        [Route("company_getinfos_oversea")]
        public IActionResult company_getinfos_oversea([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_oversea" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6bc7e7ccdb755391651316a0227c059b&companyname=%E8%B4%B5%E4%BA%BA%E9%B8%9F%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=base&box=oversea&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "base";
                    string box = "oversea";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #endregion

        #region 公司 - 风险扫描
        #region base - 整页   
        [Route("risk")]
        public IActionResult risk([FromQuery] string unique,string category,string riskType,string riskLevel,string relatedobj,string roleType,string stockPercent,string type,string caseReasonCode, string property = "1", bool iscache = true)
        {
            try
            {
                string Cachekey = "risk" + unique + category + riskType + riskLevel + relatedobj + roleType + stockPercent + type + caseReasonCode + property;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/risk?obj=1&unique=f1c5372005e04ba99175d5fd3db7b8fc&property=1&category=&riskType=&riskLevel=&relatedobj=&roleType=&stockPercent=&type=&caseReasonCode=
                    string url = "";

                    if (unique.Substring(0,1) == "p")
                    {
                         url = $"https://www.qcc.com/risk?obj=2&unique={unique}&property={property}&category={category}&riskType={riskType}&riskLevel={riskLevel}&relatedobj={relatedobj}&roleType={roleType}&stockPercent={stockPercent}&type={type}&caseReasonCode={caseReasonCode}";

                    }
                    else
                    {
                         url = $"https://www.qcc.com/risk?obj=1&unique={unique}&property={property}&category={category}&riskType={riskType}&riskLevel={riskLevel}&relatedobj={relatedobj}&roleType={roleType}&stockPercent={stockPercent}&type={type}&caseReasonCode={caseReasonCode}";

                    }

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    HtmlNodeCollection basicRows = doc.DocumentNode.SelectNodes("//a");
                    if (basicRows != null)
                    {
                        foreach (var item in basicRows)
                        {
                            var href = item.Attributes["href"];
                            
                            if (href != null && href.Value.Contains("/risk"))
                            {
                                item.Attributes.Remove("target");
                            }
                        }
                    }

                    //企业年报   https://www.qcc.com/firm/92532f20de28c1189a1feca4d549dcae.html#report
                    string risk = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t\"]")?.OuterHtml;
                    if (!string.IsNullOrWhiteSpace(risk))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", risk, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = risk;
                }


                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   行明细
        [Route("risk_getinfos_2")]
        public IActionResult risk_getinfos_2([FromQuery] string keyno, string type,string participant,string CaseReason,string CaseRole,string his,string insert, string tag, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "risk_getinfos_2" + keyno + type + participant + CaseReason + CaseRole + his + insert + tag + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/risk_getinfos?keyno=f1c5372005e04ba99175d5fd3db7b8fc&name=深圳市腾讯计算机系统有限公司&type=prosecutor&participant=p&CaseReason=侵害作品信息网络传播权纠纷&CaseRole=1&his=&insert=wenshu_1610439803160&tag=wenshu&p=1

                    string url = $"https://www.qcc.com/risk_getinfos?keyno={keyno}&name=a&type={type}&participant={participant}&CaseReason={CaseReason}&CaseRole={CaseRole}&his={his}&insert={insert}&tag={tag}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(keyno))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, keyno);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #endregion

        #region 公司 - 查看动态
        #region 自身动态
        [Route("dynamic_dynamiclist_dl")]
        public IActionResult dynamic_dynamiclist_dl([FromQuery] string keyno, string ajax, string category, string date, string importanceFlag, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "dynamic_dynamiclist_dl" + keyno + category + date + importanceFlag + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/dynamic_dynamiclist?keyno=f1c5372005e04ba99175d5fd3db7b8fc&dtype=1&ajax=1&p=1&category=62,66,67&date=2021-01-12,2021-01-13&importanceFlag=1
                    //https://www.qcc.com/dynamic_dynamiclist?keyno=f1c5372005e04ba99175d5fd3db7b8fc&dtype=2&ajax=1&importanceFlag=1&p=1

                    //string url = $"https://www.qcc.com/dynamic_dynamiclist?keyno={keyno}&dtype=1&ajax={ajax}&p={p}&category={category}&date={date}&importanceFlag={importanceFlag}";

                    string url = $"https://www.qcc.com/dl_{keyno}.html?p={p}&category={category}&date={date}&importanceFlag={importanceFlag}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(keyno))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, keyno);

                    HtmlNodeCollection basicRows = doc.DocumentNode.SelectNodes("//a");
                    if (basicRows != null)
                    {
                        foreach (var item in basicRows)
                        {
                            var href = item.Attributes["href"];

                            if (href != null && (href.Value.Contains("dl.html") || href.Value.Contains("dlr.html")))
                            {
                                item.Attributes.Remove("target");
                            }
                        }
                    }

                    string div = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t block\"]")?.OuterHtml;

                    
                    if (!string.IsNullOrWhiteSpace(div)){RedisHelpers.HashSet(Cachekey, "default", div, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = div;
                }
                 
                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region  关联动态
        [Route("dynamic_dynamiclist_dlr")]
        public IActionResult dynamic_dynamiclist_dlr([FromQuery] string keyno, string ajax, string category, string date, string importanceFlag, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "dynamic_dynamiclist_dlr" + keyno  + category + date + importanceFlag + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/dynamic_dynamiclist?keyno=f1c5372005e04ba99175d5fd3db7b8fc&dtype=2&ajax=1&p=1&category=62,66,67&date=2021-01-12,2021-01-13&importanceFlag=1
                    //string url = $"https://www.qcc.com/dynamic_dynamiclist?keyno={keyno}&dtype=2&ajax={ajax}&p={p}&category={category}&date={date}&importanceFlag={importanceFlag}";

                    string url = $"https://www.qcc.com/dlr_{keyno}.html?p={p}&category={category}&date={date}&importanceFlag={importanceFlag}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(keyno))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, keyno);

                    HtmlNodeCollection basicRows = doc.DocumentNode.SelectNodes("//a");
                    if (basicRows != null)
                    {
                        foreach (var item in basicRows)
                        {
                            var href = item.Attributes["href"];

                            if (href != null && (href.Value.Contains("dl.html") || href.Value.Contains("dlr.html")))
                            {
                                item.Attributes.Remove("target");
                            }
                        }
                    }


                    string div = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t block\"]")?.OuterHtml;

                    
                    if (!string.IsNullOrWhiteSpace(div)) { RedisHelpers.HashSet(Cachekey, "default", div, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = div;
                }

                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #endregion

        #region  公司 - 法律风险


        #region base -    破产重整
        [Route("susong_base")]
        public IActionResult susong_base([FromQuery] string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "risk_base" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=971a2bd79a3be67800a78dcc3de799e0&companyname=%E4%B9%90%E8%A7%86%E4%BA%91%E8%AE%A1%E7%AE%97%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=susong
                    //https://www.qcc.com/company_getinfos?unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=a&tab=susong
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab=susong";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    //破产重整  https://www.qcc.com/firm/6d0d8ea6d74fda77d98d25bb5982ffb7.html#susong
                    string bankruptcy = doc.DocumentNode.SelectSingleNode("//section[@id=\"bankruptcylist\"]")?.OuterHtml;
                    

                    var retobj = new
                    {
                        bankruptcy = bankruptcy,
                    };

                    string value = JsonConvert.SerializeObject(retobj);
                    if (!string.IsNullOrWhiteSpace(bankruptcy) )
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion



        //案件详细
        [Route("casedetail")]
        public IActionResult casedetail(string unique,bool iscache = true)
        {
            try
            {
                string Cachekey = "casedetail" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/case/6f5efd02ce41acfc2d645256b97436ad.html
                    string url = $"https://www.qcc.com/case/{unique}.html";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    var item = doc.DocumentNode.SelectSingleNode("//div[@class=\"col-md-9\"]");
                    if (item != null)
                    {
                        item.RemoveClass();
                        string casedetail = item.OuterHtml;

                        if (!string.IsNullOrWhiteSpace(casedetail))
                        {
                            RedisHelpers.HashSet(Cachekey, "default", casedetail, new TimeSpan(2, 0, 0, 0));
                        }
                        CacheValue = casedetail;
                    }
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }

        //文书详细
        [Route("wenshudetail")]
        public IActionResult wenshudetail(string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "wenshuDetail" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/wenshuDetail/e531476a1ddbf6fadbda7dc60142d911.html
                    string url = $"https://www.qcc.com/wenshuDetail/{unique}.html";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    var item = doc.DocumentNode.SelectSingleNode("//div[@class=\"col-md-9\"]");
                    if (item != null)
                    {
                        item.RemoveClass();
                        string casedetail = item.OuterHtml;

                        if (!string.IsNullOrWhiteSpace(casedetail))
                        {
                            RedisHelpers.HashSet(Cachekey, "default", casedetail, new TimeSpan(2, 0, 0, 0));
                        }
                        CacheValue = casedetail;
                    }

                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }

        //
        [Route("shixinDetail")]
        public IActionResult shixinDetail(string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "shixinDetail" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/shixinDetail/8e8cf8026e43bab9af5cc931f84134af2.html
                    string url = $"https://www.qcc.com/shixinDetail/{unique}.html";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    var item = doc.DocumentNode.SelectSingleNode("//div[@class=\"col-md-9\"]");
                    if (item != null)
                    {
                        item.RemoveClass();
                        string casedetail = item.OuterHtml;

                        if (!string.IsNullOrWhiteSpace(casedetail))
                        {
                            RedisHelpers.HashSet(Cachekey, "default", casedetail, new TimeSpan(2, 0, 0, 0));
                        }
                        CacheValue = casedetail;
                    }

                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }

        //
        [Route("zhixingDetail")]
        public IActionResult zhixingDetail(string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "zhixingDetail" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/zhixingDetail/0793bc4f4bd12f4e5d0126fb4807aad71.html
                    string url = $"https://www.qcc.com/zhixingDetail/{unique}.html";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    var item = doc.DocumentNode.SelectSingleNode("//div[@class=\"col-md-9\"]");
                    if (item != null)
                    {
                        item.RemoveClass();
                        string casedetail = item.OuterHtml;

                        if (!string.IsNullOrWhiteSpace(casedetail))
                        {
                            RedisHelpers.HashSet(Cachekey, "default", casedetail, new TimeSpan(2, 0, 0, 0));
                        }
                        CacheValue = casedetail;
                    }

                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }

        [Route("more_shixin")]
        public IActionResult more_shixin([FromQuery] string sstype, string key, string index, string province, string startDateBegin, string startDateEnd,string casetype,string sortField,string isSortAsc, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "more_shixin" + sstype + key + index + province + startDateBegin + startDateEnd + casetype + sortField + isSortAsc + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/more_shixin?sstype=0&key=%E5%9B%BA%E8%BE%BE%E6%9C%BA%E6%A2%B0&index=&province=&startDateBegin=&startDateEnd=&ajaxflag=true&p=1
                    string url = $"https://www.qcc.com/more_shixin?sstype={sstype}&key={key}&index={index}&province={province}&startDateBegin={startDateBegin}&startDateEnd={startDateEnd}&ajaxflag=true&casetype={casetype}&sortField={sortField}&isSortAsc={isSortAsc}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, "");

                    //HtmlNodeCollection ajaxlists = doc.DocumentNode.SelectNodes("//div[@id=\"ajaxlist\"]");
                    //if (ajaxlists != null)
                    //{
                    //    foreach (var item in ajaxlists)
                    //    {
                    //        item.Attributes.Remove("class");

                    //    }
                    //}


                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)) { RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue); ;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        [Route("more_caserelatlist")]
        public IActionResult more_caserelatlist([FromQuery] string ids, bool iscache = true)
        {
            try
            {
                string Cachekey = "more_caserelatlist" + ids;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/more_caserelatlist?ids=f264c8667f0b198b63804066ab36f5aa&isNew=1
                    string url = $"https://www.qcc.com/more_caserelatlist?ids={ids}&isNew=1";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(ids))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, "");

                    
                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)) { RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue); ;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        

        #region 裁判文书统计分析
        [Route("company_getinfos_summary")]
        public IActionResult company_getinfos_summary([FromQuery] string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_summary" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=971a2bd79a3be67800a78dcc3de799e0&companyname=乐视云计算有限公司&tab=susong
                    //companyname = CommonClass.UrlEncode(companyname);
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, unique);
                    string data = ResultModel.Html.Replace(" ", "").Replace("\n", "").Replace("	", "");

                    int start = data.IndexOf("varwenshuList=JSON.parse('") + 26;
                    int length = data.IndexOf("');vargonggaoList") - start;

                    string aa = data.Substring(start, length);

                    RedisHelpers.HashSet(Cachekey, "default", aa, new TimeSpan(2, 0, 0, 0));
                    CacheValue = aa;
                }

                JObject datas = JObject.Parse(CacheValue);

                return Json(datas);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 司法案件
        [Route("company_getinfos_susong")]
        public IActionResult company_getinfos_susong([FromQuery]string caselrole, string caseltype, string caselreason, string caselround, string caselTag, string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_susong" + caseltype + caselreason + caselround + caselTag + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=case&caseltype=&caselreason=&caselround=&caselTag=&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //https://www.qcc.com/company_getinfos?box=case&caselrole=P&caseltype=1&caselreason=侵害商标权纠纷&caselround=民事一审&caselTag=7&unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=美的集团股份有限公司&tab=susong&p=1
                    string box = "case";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?caselrole={caselrole}&caseltype={caseltype}&caselreason={caselreason}&caselround={caselround}&caselTag={caselTag}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 被执行人信息 
        [Route("company_getinfos_zhixing")]
        public IActionResult company_getinfos_zhixing([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_zhixing" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=lian&latype=prosecutor&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "zhixing";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 失信被执行人
        [Route("company_getinfos_shixin")]
        public IActionResult company_getinfos_shixin([FromQuery] string courtyear, string executestatus, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_shixin" + courtyear + executestatus + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?courtyear=2020&executestatus=全部未履行&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&box=shixin&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "shixin";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?courtyear={courtyear}&executestatus={executestatus}&unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 限制高消费
        [Route("company_getinfos_sumptuary")]
        public IActionResult company_getinfos_sumptuary([FromQuery] string sumtype, string sumcourtyear, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_sumptuary" + sumtype + sumcourtyear + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?sumtype=main&sumcourtyear=2020&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&box=sumptuary&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "sumptuary";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?sumtype={sumtype}&sumcourtyear={sumcourtyear}&unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion

        #region 限制出境
        #endregion

        #region 终本案件
        [Route("company_getinfos_endexecutioncase")]
        public IActionResult company_getinfos_endexecutioncase([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_endexecutioncase" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&p=2&tab=susong&box=endexecutioncase
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "endexecutioncase";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }
        #endregion


        #region 裁判文书
        [Route("company_getinfos_wenshu")]
        public IActionResult company_getinfos_wenshu([FromQuery] string casereason, string wsparticipant,string wssubmityear,string wscourtlevel,string wscasetype,string wstrialround,string wsdoctype,string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_wenshu" + casereason + wsparticipant + wssubmityear + wscourtlevel + wscasetype + wstrialround + wsdoctype + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=wenshu&casereason=B05020113&wsparticipant=d&wssubmityear=2017&wscourtlevel=2&wscasetype=ms&wstrialround=民事一审&wsdoctype=adj&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //https://www.qcc.com/company_getinfos?box=wenshu&casereason=0&wsparticipant=0&wssubmityear=2020&wscourtlevel=2&wscasetype=ms&wstrialround=民事一审&wsdoctype=ver&unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=东北特殊钢集团股份有限公司&tab=susong&p=1
                    string box = "wenshu";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?casereason={casereason}&wsparticipant={wsparticipant}&wssubmityear={wssubmityear}&wscourtlevel={wscourtlevel}&wscasetype={wscasetype}&wstrialround={wstrialround}&wsdoctype={wsdoctype}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 法院公告
        [Route("company_getinfos_gonggao")]
        public IActionResult company_getinfos_gonggao([FromQuery] string ggparticipant, string ggcasereason, string ggcasetype, string ggcourtyear, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_gonggao" + ggparticipant + ggcasereason + ggcasetype + ggcourtyear + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?ggparticipant=d&ggcasereason=广告合同纠纷&ggcasetype=&ggcourtyear=2020&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&box=gonggao&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "gonggao";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?ggparticipant={ggparticipant}&ggcasereason={ggcasereason}&ggcasetype={ggcasetype}&ggcourtyear={ggcourtyear}&unique={unique}&companyname=a&tab={tab}&box={box}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }


                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion


        #region 开庭公告
        [Route("company_getinfos_notice")]
        public IActionResult company_getinfos_notice([FromQuery] string nttype, string ntcasereason, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_notice" + nttype + ntcasereason + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=notice&nttype=prosecutor&ntcasereason=著作权权属、侵权纠纷&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "notice";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?nttype={nttype}&ntcasereason={ntcasereason}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }

        }

        #endregion

        #region 送达公告
        [Route("company_getinfos_dnotice")]
        public IActionResult company_getinfos_dnotice([FromQuery] string dntype, string dncasereason,string dncourtyear, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_dnotice" + dntype + dncasereason + dncourtyear + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=dnotice&dntype=prosecutor&dncasereason=&dncourtyear=&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "dnotice";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?dntype={dntype}&dncasereason={dncasereason}&dncourtyear={dncourtyear}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion


        #region 询价评估 - 评估结果
        [Route("company_getinfos_inquiryevaluation")]
        public IActionResult company_getinfos_inquiryevaluation([FromQuery] string intype, string incaseno, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_inquiryevaluation" + intype + incaseno + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=inquiryevaluation&intype=target&incaseno=（2020）京0108执恢107号&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "inquiryevaluation";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?intype={intype}&incaseno={incaseno}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 询价评估 - 选定评估机构
        [Route("company_getinfos_evaluationagency")]
        public IActionResult company_getinfos_evaluationagency([FromQuery]string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_evaluationagency" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "evaluationagency";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 司法拍卖
        [Route("company_getinfos_judicialsale")]
        public IActionResult company_getinfos_judicialsale([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_judicialsale" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "judicialsale";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 股权冻结
        [Route("company_getinfos_assistance")]
        public IActionResult company_getinfos_assistance([FromQuery]string asstype, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_assistance" + asstype + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=assistance&asstype=executed&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //https://www.qcc.com/company_getinfos?box=assistance&asstype=0&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //https://www.qcc.com/company_getinfos?box=assistance&asstype=executed&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //https://www.qcc.com/company_getinfos?box=assistance&asstype=executed&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=2&firstCategory=ce
                    string box = "assistance";
                    string tab = "susong";
                    string firstCategory = string.Empty ;
                    if (p > 1)
                    {
                        firstCategory = "ce";
                    }
                    string url = $"https://www.qcc.com/company_getinfos?asstype={asstype}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}&firstCategory={firstCategory}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 诉前调解
        [Route("company_getinfos_pretrialmediation")]
        public IActionResult company_getinfos_pretrialmediation([FromQuery] string pretrialmediationtype, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_pretrialmediation" + pretrialmediationtype + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?box=pretrialmediation&pretrialmediationtype=appellor&unique=971a2bd79a3be67800a78dcc3de799e0&companyname=乐视云计算有限公司&tab=susong&p=1
                    //companyname = CommonClass.UrlEncode(companyname);
                    string box = "pretrialmediation";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?pretrialmediationtype={pretrialmediationtype}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 立案信息
        [Route("company_getinfos_lian")]
        public IActionResult company_getinfos_lian([FromQuery] string latype, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_lian" + latype + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {


                    //https://www.qcc.com/company_getinfos?box=lian&latype=prosecutor&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=乐视网信息技术（北京）股份有限公司&tab=susong&p=1
                    //https://www.qcc.com/company_getinfos?box=lian&latype=prosecutor&unique=eac35f7cb2922037a2f7e0525d8cf0cb&companyname=美的集团股份有限公司&p=2&tab=susong
                    string box = "lian";
                    string tab = "susong";
                    string url = $"https://www.qcc.com/company_getinfos?latype={latype}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #endregion

        #region  公司 - 经营风险



        #region 用户投诉
        [Route("company_getinfos_usercomplaint")]
        public IActionResult company_getinfos_usercomplaint([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_usercomplaint" + unique + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=f1c5372005e04ba99175d5fd3db7b8fc&companyname=深圳市腾讯计算机系统有限公司&p=2&tab=fengxian&box=usercomplaint&firstCategory=laint
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab=fengxian&box=usercomplaint&firstCategory=laint";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = doc.DocumentNode.OuterHtml;

                }


                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion


        #region 合作风险/竞争风险
        [Route("risk_getCooperateInfos")]
        public IActionResult risk_getCooperateInfos([FromQuery] string obj,string year,string pd, string unique,string casereason ,string jzc , bool iscache = true)
        {
            try
            {
                string Cachekey = "risk_getCooperateInfos" + obj + year + pd + unique + casereason + jzc;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {



                    //https://www.qcc.com/risk_cooperate?obj=1&unique=84c17a005a759a5e0d875c1ebb6c9846&year=2019&pd=1
                    string url = $"https://www.qcc.com/risk_cooperate?obj={obj}&unique={unique}&year={year}&pd={pd}&casereason={casereason}&jzc={jzc}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    string html = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t\"]")?.OuterHtml;
                    if (!string.IsNullOrWhiteSpace(html))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", html, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = html;

                }


                return Content(CacheValue);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 合作风险/竞争风险 - 点击列明细
        [Route("risk_getinfos")]
        public IActionResult risk_getinfos([FromQuery] string keyno, string uniqueId, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "risk_getinfos" + keyno + uniqueId + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    string tag = "cooperate";
                    //https://www.qcc.com/risk_getinfos?keyno=ee11a1df73420c6890f0f74609fda045&name=武汉手盟网络科技股份有限公司&uniqueId=f1c5372005e04ba99175d5fd3db7b8fc_P_ee11a1df73420c6890f0f74609fda045__0&tag=cooperate&p=1
                    string url = $"https://www.qcc.com/risk_getinfos?keyno={keyno}&name=a&uniqueId={uniqueId}&tag={tag}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(keyno))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, keyno);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }


                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region base -    经营异常Exceptions      /严重违法 svList        /股权质押 spledge       /税收违法 taxillegal       /清算信息liquidation     /简易注销  simpleCancellationlist          /注销备案enliqInfo
        [Route("risk_base")]
        public IActionResult risk_base([FromQuery] string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "risk_base" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=971a2bd79a3be67800a78dcc3de799e0&companyname=%E4%B9%90%E8%A7%86%E4%BA%91%E8%AE%A1%E7%AE%97%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=susong
                    //https://www.qcc.com/firm/7b56d0143ada62ce06989e7c31e98497.html#fengxian
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab=fengxian";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    //经营异常  https://www.qcc.com/firm/7b56d0143ada62ce06989e7c31e98497.html#fengxian
                    string Exceptions = doc.DocumentNode.SelectSingleNode("//section[@id=\"Exceptions\"]")?.OuterHtml;
                    //严重违法  https://www.qcc.com/firm/25b8b9576567bfe5b197d595468a608d.html#fengxian
                    string svList = doc.DocumentNode.SelectSingleNode("//section[@id=\"svList\"]")?.OuterHtml;
                    //股权质押   https://www.qcc.com/firm/84c17a005a759a5e0d875c1ebb6c9846.html#fengxian
                    var spledgenode = doc.DocumentNode.SelectSingleNode("//section[@id=\"spledge\"]/div[@class=\"float-wrap clearfix\"]");
                    if (spledgenode != null)
                    {
                        spledgenode.Remove();
                        var spledgenodeti = doc.DocumentNode.SelectSingleNode("//section[@id=\"spledge\"]/div[2]");
                        if (spledgenodeti != null)
                        {
                            spledgenodeti.Remove();
                        }
                    }
                    string spledge = doc.DocumentNode.SelectSingleNode("//section[@id=\"spledge\"]")?.OuterHtml;
                    //税收违法  https://www.qcc.com/firm/e6fd616036feb644b5a8147ad061bbb2.html#fengxian
                    string taxillegal = doc.DocumentNode.SelectSingleNode("//section[@id=\"taxillegallist\"]")?.OuterHtml;
                    //清算信息    https://www.qcc.com/firm/c638f33f5484aa62883a1ac98661fa9d.html#fengxian
                    string liquidation = doc.DocumentNode.SelectSingleNode("//section[@id=\"LiquidationList\"]")?.OuterHtml;
                    //简易注销   https://www.qcc.com/firm/c4d93e3abacd8423f31e97a56864cb1f.html#fengxian
                    string simpleCancellationlist = doc.DocumentNode.SelectSingleNode("//section[@id=\"simpleCancellationlist\"]")?.OuterHtml;
                    //注销备案   https://www.qcc.com/firm/6e4c1c406e239355b66a8231ff4b29a8.html#fengxian
                    string enliqInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"enliqInfo\"]")?.OuterHtml;
                    
                    var retobj = new
                    {
                        Exceptions = Exceptions,
                        svList = svList,
                        spledge = spledge,
                        taxillegal = taxillegal,
                        liquidation = liquidation,
                        simpleCancellationlist = simpleCancellationlist,
                        enliqInfo = enliqInfo
                    };

                    string value = JsonConvert.SerializeObject(retobj);
                    if (!string.IsNullOrWhiteSpace(Exceptions) || !string.IsNullOrWhiteSpace(svList) || !string.IsNullOrWhiteSpace(spledge) || !string.IsNullOrWhiteSpace(taxillegal) || !string.IsNullOrWhiteSpace(liquidation) ||
                        !string.IsNullOrWhiteSpace(simpleCancellationlist) || !string.IsNullOrWhiteSpace(enliqInfo) )
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion


        #region 股权质押2 
        [Route("company_getinfos_spledge")]
        public IActionResult company_getinfos_spledge([FromQuery] string spletype, string splestatus,string subbox,string tradeDate, string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_spledge" + spletype + splestatus + subbox + tradeDate + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=spledge&tab=fengxian&spletype=0&splestatus=0&unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=东北特殊钢集团股份有限公司&p=1
                    string tab = "fengxian";
                    string box = "spledge";
                    string url = string.Empty;
                    if (subbox == null)
                    {
                        url = $"https://www.qcc.com/company_getinfos?spletype={spletype}&splestatus={splestatus}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    }
                    else
                    {
                        url = $"https://www.qcc.com/company_getinfos?subbox={subbox}&tradeDate={tradeDate}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    }
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)) { RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue); ;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 股权出质
        [Route("company_getinfos_pledge")]
        public IActionResult company_getinfos_pledge([FromQuery]string pletype,string plestatus, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_pledge" + pletype + plestatus + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=pledge&pletype=pledgor&plestatus=无效&unique=7b56d0143ada62ce06989e7c31e98497&companyname=北京拜克洛克科技有限公司&tab=fengxian&p=1
                    string tab = "fengxian";
                    string box = "pledge";

                    string url = $"https://www.qcc.com/company_getinfos?pletype={pletype}&plestatus={plestatus}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 行政处罚
        [Route("company_getinfos_adminpenalty")]
        public IActionResult company_getinfos_adminpenalty([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_adminpenalty" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=f1c5372005e04ba99175d5fd3db7b8fc&companyname=深圳市腾讯计算机系统有限公司&p=2&tab=fengxian&box=adminpenalty
                    string tab = "fengxian";
                    string box = "adminpenalty";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 环保处罚
        [Route("company_getinfos_env")]
        public IActionResult company_getinfos_env([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_env" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=04db3ac5e7235948c2ab78fe1cf7fd7c&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=env
                    string tab = "fengxian";
                    string box = "env";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 动产抵押
        [Route("company_getinfos_mpledge")]
        public IActionResult company_getinfos_mpledge([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_mpledge" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=mpledge
                    string tab = "fengxian";
                    string box = "mpledge";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 担保信息
        [Route("company_getinfos_guarantor")]
        public IActionResult company_getinfos_guarantor([FromQuery] string unique, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_guarantor" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //http://localhost:8090/company_getinfos_guarantor?unique=6d0d8ea6d74fda77d98d25bb5982ffb7
                    string tab = "fengxian";
                    string box = "guarantor";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)) { RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue); ;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region 破产重整
        [Route("company_getinfos_bankruptcy")]
        public IActionResult company_getinfos_bankruptcy([FromQuery] string unique,string bktype,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_bankruptcy" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=东北特殊钢集团股份有限公司&p=1&tab=fengxian&box=bankruptcy
                    //https://www.qcc.com/company_getinfos?unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=东北特殊钢集团股份有限公司&p=1&tab=fengxian&box=bankruptcy&bktype=1
                    string tab = "fengxian";
                    string box = "bankruptcy";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}&bktype={bktype}";
                    url = $"https://www.qcc.com/company_getinfos?box=bankruptcy&bktype=1&unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=%E4%B8%9C%E5%8C%97%E7%89%B9%E6%AE%8A%E9%92%A2%E9%9B%86%E5%9B%A2%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=fengxian&p=1";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 土地抵押
        #endregion

        #region   公示催告
        [Route("company_getinfos_pn")]
        public IActionResult company_getinfos_pn([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_pn" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6e4c1c406e239355b66a8231ff4b29a8&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=pn
                    string tab = "fengxian";
                    string box = "pn";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   欠税公告
        [Route("company_getinfos_owenotice")]
        public IActionResult company_getinfos_owenotice([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {

                string Cachekey = "company_getinfos_owenotice" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=e6fd616036feb644b5a8147ad061bbb2&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=owenotice
                    string tab = "fengxian";
                    string box = "owenotice";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }


                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   黑名单
        [Route("company_getinfos_blackcom")]
        public IActionResult company_getinfos_blackcom([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_blackcom" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=b2e934e4a360c6667966e52ffdc6ec00&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=blackcom
                    string tab = "fengxian";
                    string box = "blackcom";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   产品召回
        [Route("company_getinfos_productrecall")]
        public IActionResult company_getinfos_productrecall([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_productrecall" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=productrecall
                    string tab = "fengxian";
                    string box = "productrecall";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   知识产权出质
        [Route("company_getinfos_patentpledge")]
        public IActionResult company_getinfos_patentpledge([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_patentpledge" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=b70c3e417347f69e3325faced37f18be&companyname=%E6%B7%B1%E5%9C%B3%E5%B8%82%E8%85%BE%E8%AE%AF%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=fengxian&box=patentpledge
                    string tab = "fengxian";
                    string box = "patentpledge";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #endregion

        #region  公司 - 经营信息

        #region base -     /行政许可 licenslist      /税务信用taxCreditList
        [Route("run_base")]
        public IActionResult run_base([FromQuery] string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "run_base" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/firm/52313235c549c109ff0c5ebbba7605d2.html#run
                    //https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab=fengxian
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab=run";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    //行政许可   https://www.qcc.com/firm/52313235c549c109ff0c5ebbba7605d2.html#run
                    string licenslist = doc.DocumentNode.SelectSingleNode("//section[@id=\"licenslist\"]")?.OuterHtml;
                    //税务信用
                    string taxCreditList = doc.DocumentNode.SelectSingleNode("//section[@id=\"taxCreditList\"]")?.OuterHtml;

                    var retobj = new
                    {
                        licenslist = licenslist,
                        taxCreditList = taxCreditList
                    };

                    string value = JsonConvert.SerializeObject(retobj);
                    if (!string.IsNullOrWhiteSpace(licenslist) || !string.IsNullOrWhiteSpace(taxCreditList))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   行政许可 [工商局] 翻页
        [Route("company_getinfos_licens")]
        public IActionResult company_getinfos_licens([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_licens" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=2&tab=run&box=licens
                    string tab = "run";
                    string box = "licens";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   招投标
        [Route("company_getinfos_tender")]
        public IActionResult company_getinfos_tender([FromQuery] string tenderPublishYear,string tenderProgress,string tenderProvince, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_tender" + tenderPublishYear + tenderProgress + tenderProvince + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=tender&tenderPublishYear=2020&tenderProgress=&tenderProvince=&unique=52313235c549c109ff0c5ebbba7605d2&companyname=东风汽车股份有限公司&tab=run&p=1
                    string box = "tender";
                    string tab = "run";
                    string url = $"https://www.qcc.com/company_getinfos?tenderPublishYear={tenderPublishYear}&tenderProgress={tenderProgress}&tenderProvince={tenderProvince}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   业务竞争
        [Route("company_getinfos_competitor")]
        public IActionResult company_getinfos_competitor([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_competitor" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=东风汽车股份有限公司&p=2&tab=run&box=competitor
                    string tab = "run";
                    string box = "competitor";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   招聘
        [Route("company_getinfos_job")]
        public IActionResult company_getinfos_job([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_job" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {


                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=job
                    string tab = "run";
                    string box = "job";


                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   进出口信用
        [Route("company_getinfos_ciax")]
        public IActionResult company_getinfos_ciax([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_ciax" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=ciax
                    string tab = "run";
                    string box = "ciax";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   地块公示
        [Route("company_getinfos_landpub")]
        public IActionResult company_getinfos_landpub([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_landpub" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {


                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=landpub
                    string tab = "run";
                    string box = "landpub";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   购地信息
        [Route("company_getinfos_landpurchase")]
        public IActionResult company_getinfos_landpurchase([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_landpurchase" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=landpurchase
                    string tab = "run";
                    string box = "landpurchase";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }


                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   土地转让
        [Route("company_getinfos_landmarket")]
        public IActionResult company_getinfos_landmarket([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_landmarket" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=3ef9daa84aae2f8ea0923a5aa575c896&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=landmarket
                    string tab = "run";
                    string box = "landmarket";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   债券信息
        [Route("company_getinfos_creditor")]
        public IActionResult company_getinfos_creditor([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_creditor" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=creditor
                    string tab = "run";
                    string box = "creditor";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   抽查检查
        [Route("company_getinfos_spotcheck")]
        public IActionResult company_getinfos_spotcheck([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_spotcheck" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=spotcheck
                    string tab = "run";
                    string box = "spotcheck";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   电信许可 
        [Route("company_getinfos_telecom")]
        public IActionResult company_getinfos_telecom([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_telecom" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=98d98ed5eed32ffba68f78eb076a98e4&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=telecom
                    string tab = "run";
                    string box = "telecom";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   供应商 
        [Route("company_getinfos_supplier")]
        public IActionResult company_getinfos_supplier([FromQuery] string unique,string supplieryear,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_supplier" + unique  + supplieryear + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=supplier&supplieryear=2019&unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=a&tab=run&p=1
                    string tab = "run";
                    string box = "supplier";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}&supplieryear={supplieryear}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   客户 
        [Route("company_getinfos_customer")]
        public IActionResult company_getinfos_customer([FromQuery] string unique, string customeryear, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_customer" + unique + customeryear + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?box=customer&customeryear=all&unique=84c17a005a759a5e0d875c1ebb6c9846&companyname=a&tab=run&p=1
                    string tab = "run";
                    string box = "customer";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&customeryear={customeryear}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   信用评级 
        [Route("company_getinfos_creditrate")]
        public IActionResult company_getinfos_creditrate([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_creditrate" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {


                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=creditrate
                    string tab = "run";
                    string box = "creditrate";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   双随机抽查 
        [Route("company_getinfos_drc")]
        public IActionResult company_getinfos_drc([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_drc" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=drc
                    string tab = "run";
                    string box = "drc";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   一般纳税人 
        [Route("company_getinfos_taxpayer")]
        public IActionResult company_getinfos_taxpayer([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_taxpayer" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=52313235c549c109ff0c5ebbba7605d2&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=taxpayer
                    string tab = "run";
                    string box = "taxpayer";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   产权交易 
        [Route("company_getinfos_transaction")]
        public IActionResult company_getinfos_transaction([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_transaction" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=6d0d8ea6d74fda77d98d25bb5982ffb7&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=transaction
                    string tab = "run"; string box = "transaction";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   食品安全 
        [Route("company_getinfos_foodsafety")]
        public IActionResult company_getinfos_foodsafety([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_foodsafety" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=92532f20de28c1189a1feca4d549dcae&companyname=%E4%B8%9C%E9%A3%8E%E6%B1%BD%E8%BD%A6%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&p=1&tab=run&box=foodsafety
                    string tab = "run"; string box = "foodsafety";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #endregion

        #region 公司 - 企业发展
        #region base -     /企业年报reportyear        /融资信息    /投资机构   /核心人员     /企业业务   /竞品信息    /私募基金
        [Route("report_base")]
        public IActionResult report_base([FromQuery] string unique, bool iscache = true)
        {
            try
            {
                string Cachekey = "report_base" + unique;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {


                    //https://www.qcc.com/firm/52313235c549c109ff0c5ebbba7605d2.html#report
                    //https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab=run
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab=report";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    //企业年报   https://www.qcc.com/firm/92532f20de28c1189a1feca4d549dcae.html#report
                    string reportyear = doc.DocumentNode.SelectSingleNode("//section[@id=\"reportyear\"]")?.OuterHtml;
                    //融资信息   https://www.qcc.com/firm/f625a5b661058ba5082ca508f99ffe1b.html#report
                    string financingInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"financingInfo\"]")?.OuterHtml;
                    //投资机构   https://www.qcc.com/firm/f625a5b661058ba5082ca508f99ffe1b.html#report
                    string investAgencyInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"investAgencyInfo\"]")?.OuterHtml;
                    //核心人员
                    string memberInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"memberInfo\"]")?.OuterHtml;
                    //企业业务
                    string productInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"productInfo\"]")?.OuterHtml;
                    //竞品信息
                    string compatProductInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"compatProductInfo\"]")?.OuterHtml;
                    //私募基金   https://www.qcc.com/firm/5c6136df3ad9128b2f766c128d734914.html#report
                    string simuInfo = doc.DocumentNode.SelectSingleNode("//section[@id=\"simuInfo\"]")?.OuterHtml;

                    var retobj = new
                    {
                        reportyear = reportyear,
                        financingInfo = financingInfo,
                        investAgencyInfo = investAgencyInfo,
                        memberInfo = memberInfo,
                        productInfo = productInfo,
                        compatProductInfo = compatProductInfo,
                        simuInfo = simuInfo
                    };

                    string value = JsonConvert.SerializeObject(retobj);
                    if (!string.IsNullOrWhiteSpace(reportyear) || !string.IsNullOrWhiteSpace(financingInfo) || !string.IsNullOrWhiteSpace(investAgencyInfo) ||
                        !string.IsNullOrWhiteSpace(memberInfo) || !string.IsNullOrWhiteSpace(productInfo) || !string.IsNullOrWhiteSpace(compatProductInfo) || !string.IsNullOrWhiteSpace(simuInfo) )
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   上榜榜单
        [Route("company_getinfos_sbbd")]
        public IActionResult company_getinfos_sbbd([FromQuery] string bdpublishyear,string bdtype, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_sbbd" + bdpublishyear + bdtype + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?bdpublishyear=2020&bdtype=企业&unique=6bc7e7ccdb755391651316a0227c059b&companyname=万科企业股份有限公司&tab=report&p=1&box=sbbd
                    string tab = "report"; string box = "sbbd";
                    string url = $"https://www.qcc.com/company_getinfos?bdpublishyear={bdpublishyear}&bdtype={bdtype}&unique={unique}&companyname=a&p={p}&tab={tab}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion


        #endregion

        #region  公司 - 知识产权
        
        #region   商标信息
        [Route("company_getinfos_shangbiao")]
        public IActionResult company_getinfos_shangbiao([FromQuery] string sbappdateyear, string sbstatus,string sbflowno,string sbintcls, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_shangbiao" + sbappdateyear + sbstatus + sbflowno + sbintcls + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?sbappdateyear=2008&sbstatus=&sbflowno=8&sbintcls=9&unique=1990aed8096105169d5d36193eab4e79&companyname=招商银行股份有限公司&tab=assets&p=1&box=shangbiao
                    string tab = "assets"; string box = "shangbiao";
                    string url = $"https://www.qcc.com/company_getinfos?sbappdateyear={sbappdateyear}&sbstatus={sbstatus}&sbflowno={sbflowno}&sbintcls={sbintcls}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   专利信息
        [Route("company_getinfos_zhuanli")]
        public IActionResult company_getinfos_zhuanli([FromQuery] string zlpublicationyear, string zlipclist, string zlkindcode, string zllegalstatus, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_zhuanli" + zlpublicationyear + zlipclist + zlkindcode + zllegalstatus + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?zlpublicationyear=2020&zlipclist=&zlkindcode=A&zllegalstatus=0302&unique=1990aed8096105169d5d36193eab4e79&companyname=招商银行股份有限公司&tab=assets&p=1&box=zhuanli
                    string tab = "assets"; string box = "zhuanli";
                    string url = $"https://www.qcc.com/company_getinfos?zlpublicationyear={zlpublicationyear}&zlipclist={zlipclist}&zlkindcode={zlkindcode}&zllegalstatus={zllegalstatus}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   资质证书
        [Route("company_getinfos_zhengshu")]
        public IActionResult company_getinfos_zhengshu([FromQuery] string zscertCategory, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_zhengshu" + zscertCategory + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?zscertCategory=C_200_12&unique=1990aed8096105169d5d36193eab4e79&companyname=招商银行股份有限公司&tab=assets&p=1&box=zhengshu
                    string tab = "assets"; string box = "zhengshu";
                    string url = $"https://www.qcc.com/company_getinfos?zscertCategory={zscertCategory}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   作品著作权
        [Route("company_getinfos_zzq")]
        public IActionResult company_getinfos_zzq([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_zzq" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=zzq
                    string tab = "assets"; string box = "zzq";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   软件著作权
        [Route("company_getinfos_rjzzq")]
        public IActionResult company_getinfos_rjzzq([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_rjzzq" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=rjzzq
                    string tab = "assets"; string box = "rjzzq";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }


                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   备案网站
        [Route("company_getinfos_website")]
        public IActionResult company_getinfos_website([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_website" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=website
                    string tab = "assets"; string box = "website";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   APP
        [Route("company_getinfos_app")]
        public IActionResult company_getinfos_app([FromQuery]  string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_app" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=app
                    string tab = "assets"; string box = "app";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   小程序
        [Route("company_getinfos_wp")]
        public IActionResult company_getinfos_wp([FromQuery]  string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_wp" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=WP
                    string tab = "assets"; string box = "wp";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   微信公众号
        [Route("company_getinfos_wechat")]
        public IActionResult company_getinfos_wechat([FromQuery]  string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_wechat" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=wechat
                    string tab = "assets"; string box = "wechat";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   微博
        [Route("company_getinfos_weibo")]
        public IActionResult company_getinfos_weibo([FromQuery]  string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_weibo" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?unique=1990aed8096105169d5d36193eab4e79&companyname=%E6%8B%9B%E5%95%86%E9%93%B6%E8%A1%8C%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=assets&p=1&box=weibo
                    string tab = "assets"; string box = "weibo";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion



        #endregion

        #region  公司 - 新闻公告
        #region   新闻舆情
        [Route("company_getinfos_news")]
        public IActionResult company_getinfos_news([FromQuery] string newstags,string newsimpact,string newstime, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_news" + newstags + newsimpact + newstime+ unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/company_getinfos?newstags=&newsimpact=positive&newstime=&unique=b70c3e417347f69e3325faced37f18be&companyname=东莞市固达机械制造有限公司&tab=news&p=1&box=news
                    string tab = "news"; string box = "news";
                    string url = $"https://www.qcc.com/company_getinfos?newstags={newstags}&newsimpact={newsimpact}&newstime={newstime}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   企业公告
        [Route("company_getinfos_sgg")]
        public IActionResult company_getinfos_sgg([FromQuery] string sggcategory, string sggpublishYear, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_sgg" + sggcategory + sggpublishYear + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?box=sgg&sggcategory=香港公告&sggpublishYear=&unique=1990aed8096105169d5d36193eab4e79&companyname=招商银行股份有限公司&tab=news&p=1
                    string tab = "news"; string box = "sgg";
                    string url = $"https://www.qcc.com/company_getinfos?sggcategory={sggcategory}&sggpublishYear={sggpublishYear}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   相关公告
        [Route("company_getinfos_rgg")]
        public IActionResult company_getinfos_rgg([FromQuery] string rggcategory, string rggpublishYear, string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_rgg" + rggcategory + rggpublishYear + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?rggcategory=中介报告&rggpublishYear=2020&unique=5c6136df3ad9128b2f766c128d734914&companyname=深圳嘉石大岩资本管理有限公司&tab=news&p=1&box=rgg
                    string tab = "news"; string box = "rgg";
                    string url = $"https://www.qcc.com/company_getinfos?rggcategory={rggcategory}&rggpublishYear={rggpublishYear}&unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion

        #region   政府公告
        [Route("company_getinfos_zfgg")]
        public IActionResult company_getinfos_zfgg([FromQuery] string unique,  int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_zfgg" + unique  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?unique=5c6136df3ad9128b2f766c128d734914&companyname=%E6%B7%B1%E5%9C%B3%E5%98%89%E7%9F%B3%E5%A4%A7%E5%B2%A9%E8%B5%84%E6%9C%AC%E7%AE%A1%E7%90%86%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8&tab=news&p=1&box=zfgg
                    string tab = "news"; string box = "zfgg";
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}&p={p}&box={box}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion













        #endregion

        #endregion

        #region  老板
        #region  输入框模糊匹配
        [Route("gongsi_mindlist_gongsi")]
        public IActionResult gongsi_mindlist_gongsi([FromQuery] string searchKey, bool iscache = true)
        {
            try
            {
                string Cachekey = "gongsi_mindlist_gongsi" + searchKey;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/gongsi_mindlist?type=mind&searchKey=%E4%BC%81%E6%9F%A5%E6%9F%A5&searchType=0&suggest=1

                    string url = $"https://www.qcc.com/gongsi_mindlist?type=mind&searchKey={searchKey}&searchType=0&suggest=1";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(searchKey))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }
                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, searchKey);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region   搜索界面HTML
        [Route("boss_search")]
        public IActionResult boss_search([FromQuery] string key, string industryInfo, string areaInfo,int p=1, bool iscache = true)
        {
            try
            {
                string Cachekey = "boss_search" + key + industryInfo + areaInfo  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/boss_search?key=%E6%B8%A9%E5%BB%BA%E5%8D%8E&industryInfo=&areaInfo=
                    string url = $"https://www.qcc.com/boss_search?key={key}&industryInfo={industryInfo}&areaInfo={areaInfo}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    boss_search boss_search = new boss_search();
                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, key);

                    GroupItem GroupItem;
                    HtmlNodeCollection GroupItemNodes = doc.DocumentNode.SelectNodes("//div[@id=\"search-box\"]/div[@class=\"choose-box\"]/div[contains(@class,\"pills\")]");
                    if (GroupItemNodes != null)
                    {
                        foreach (var item in GroupItemNodes)
                        {
                            string Grouptype = item.SelectSingleNode(".//div[@class=\"pills-header\"]")?.InnerText.Trim();
                            GroupItem = new GroupItem();
                            if (Grouptype.Contains("省份地区"))
                            {
                                GroupItem.key = "province";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    Item.value = itema.Attributes["data-value"]?.Value.Trim();
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("城市"))
                            {
                                GroupItem.key = "city";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    Item.value = itema.Attributes["data-value"]?.Value.Trim();
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("区县"))
                            {
                                GroupItem.key = "county";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    Item.value = itema.Attributes["data-value"]?.Value.Trim();
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("行业分类"))
                            {
                                GroupItem.key = "industry";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    Item.value = itema.Attributes["data-value"]?.Value.Trim();
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("行业大类"))
                            {
                                GroupItem.key = "subindustry";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    Item.value = itema.Attributes["data-value"]?.Value.Trim();
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("行业"))
                            {
                                GroupItem.key = "thirdindustry";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    Item.value = itema.Attributes["data-value"]?.Value.Trim();
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            if (!string.IsNullOrWhiteSpace(GroupItem.key))
                            {
                                boss_search.GroupItems.Add(GroupItem);
                            }
                        }
                    }


                    var PageIndex = doc.DocumentNode.SelectSingleNode("//ul[contains(@class,\"pagination\")]/li[contains(@class,\"active\")]")?.InnerText;

                    if (PageIndex != null)
                    {
                        boss_search.Paging.PageIndex = Convert.ToInt32(Regex.Replace(PageIndex, @"[^0-9]+", ""));
                    }
                    else
                    {
                        boss_search.Paging.PageIndex = 0;
                    }
                    var TotalRecords = doc.DocumentNode.SelectSingleNode("//div[contains(@class,\"m_search_head\")]//span[@class=\"text-danger\"]")?.InnerText;
                    if (TotalRecords != null)
                    {
                        boss_search.Paging.TotalRecords = Convert.ToInt32(Regex.Replace(TotalRecords, @"[^0-9]+", ""));
                    }
                    boss_search.Paging.PageSize = 20;


                    HtmlNodeCollection m_srchListNodestr = doc.DocumentNode.SelectNodes("//div[contains(@class,\"boss-list\")]");
                    peopledetail peopledetail;
                    if (m_srchListNodestr != null)
                    {
                        foreach (var item in m_srchListNodestr)
                        {
                            peopledetail = new peopledetail();
                            peopledetail.LegalRepId = item.SelectSingleNode("./section/div/a")?.Attributes["keyno"]?.Value;
                            peopledetail.LegalRepName = item.SelectSingleNode("./section/div/a/div[1]/div[2]/div[1]")?.InnerText.Trim();
                            peopledetail.LegalRepImg = item.SelectSingleNode("./section/div/a/div[1]/div[1]//img")?.Attributes["src"]?.Value;
                            peopledetail.Intruduce = item.SelectSingleNode("./section/div/a/div[1]/div[2]/div[2]")?.InnerText.Trim();
                            HtmlNodeCollection m_srchListNodestr2 = item.SelectNodes("./section/div/a/div[2]/div");
                            if (m_srchListNodestr2 != null)
                            {
                                foreach (var item2 in m_srchListNodestr2)
                                {
                                    JObject jobject = new JObject();
                                    jobject.Add(new JProperty("Area", item2.SelectSingleNode("./div[1]")?.InnerText.Trim()));
                                    jobject.Add(new JProperty("Des", item2.SelectSingleNode("./div[2]")?.InnerText.Trim()));
                                    peopledetail.relateCompanys.Add(jobject);
                                }
                            }
                            HtmlNodeCollection m_srchListNodestr3 = item.SelectNodes("./section/div/a/div[3]/object/a");
                            if (m_srchListNodestr3 != null)
                            {
                                foreach (var item2 in m_srchListNodestr3)
                                {
                                    JObject jobject = new JObject();
                                    jobject.Add(new JProperty("img", item2.SelectSingleNode(".//img")?.Attributes["src"]?.Value));
                                    jobject.Add(new JProperty("peopleid", item2.Attributes["keyno"]?.Value));
                                    jobject.Add(new JProperty("peoplename", item2.SelectSingleNode(".//object[1]/a")?.InnerText.Trim()));
                                    jobject.Add(new JProperty("companyid", item2.SelectSingleNode(".//object[2]/a")?.Attributes["keyno"]?.Value));
                                    jobject.Add(new JProperty("companyname", item2.SelectSingleNode(".//object[2]/a")?.InnerText.Trim()));
                                    peopledetail.relatePeoples.Add(jobject);
                                }
                            }
                            if (!string.IsNullOrWhiteSpace(peopledetail.LegalRepId))
                            {
                                boss_search.peopledetails.Add(peopledetail);
                            }
                        }
                    }

                    string value = JsonConvert.SerializeObject(boss_search);
                    if (boss_search.Paging.TotalRecords > 0)
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);



                //ServiceControl serviceControl = new ServiceControl();
                //HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, key);
                //string boss = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t\"]")?.OuterHtml;
                //return Content(boss);
                //var retobj = new
                //{
                //    risk = risk,
                //};

                //return Json(retobj);


                //return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region  老板 - 基本信息
        #region  基本信息      /菜单 tab     /合作伙伴partnerlist               /历史担任法定代表人hislegalList    /历史对外投资hisinvest    /历史在外任职hispostOffice    /历史开庭公告hiscsalist    /历史法院公告hisctalist
        [Route("pl")]
        public IActionResult pl([FromQuery] string personid, bool iscache = true)
        {
            try
            {
                string Cachekey = "pl" + personid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/pl/p3483c261f318de061fb3ded0508bf90.html
                    string url = $"https://www.qcc.com/pl/{personid}.html";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);


                    HtmlNode peopleHeader = doc.DocumentNode.SelectSingleNode("//div[@class=\"row dongtai\"]");
                    if (peopleHeader != null)
                    {
                        peopleHeader.Remove();
                    }
                    HtmlNodeCollection riskTop1 = doc.DocumentNode.SelectNodes("//div[@id=\"riskTop1\"] | //div[@id=\"work_data\"]");
                    if (riskTop1 != null)
                    {
                        for (int i = 0; i < riskTop1.Count; i++)
                        {
                            riskTop1[i].Remove();
                        }
                    }
                    HtmlNode caseAnalysisTable = doc.DocumentNode.SelectSingleNode("//table[@id=\"caseAnalysisTable\"]");
                    if (caseAnalysisTable != null)
                    {
                        caseAnalysisTable.ParentNode.ParentNode.Remove();
                    }
                    

                    peopledetail peopledetail = new peopledetail();

                    //HtmlNodeCollection peopledetailNodes = doc.DocumentNode.SelectNodes("./span[contains(@class,\"fc\")]/span");
                    peopledetail.LegalRepId = personid;
                    peopledetail.LegalRepImg = doc.DocumentNode.SelectSingleNode("//div[@class=\"imgkuang\"]/img")?.Attributes["src"]?.Value.Trim();
                    peopledetail.LegalRepName = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t-md\"]/div/div/div/div/div[@class=\"content\"]/h1")?.InnerText.Trim();


                    HtmlNodeCollection tagNodes = doc.DocumentNode.SelectNodes("//div[@class=\"container m-t-md\"]/div/div/div/div/div[@class=\"content\"]/div[1]");
                    HtmlNodeCollection childTagNodes = tagNodes?[0]?.SelectNodes("./*/text()|./*/*/text()|./*/*/*/text()");


                    peopledetail.TagList = childTagNodes?.Where(p => !string.IsNullOrWhiteSpace(p.InnerText.Replace(" ", ""))).Select(p => p.InnerText).ToList();
                    peopledetail.Intruduce = doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t-md\"]/div/div/div/div/div[@class=\"content\"]/div[2]")?.InnerText.Trim();
                    //合作伙伴 https://www.qcc.com/pl/pc4eb763297cf4b8076c2e0d2fe64617.html
                    string partnerlist = doc.DocumentNode.SelectSingleNode("//div[@id=\"partnerlist\"]")?.OuterHtml;
                    //历史信息  历史担任法定代表人
                    string hislegalList = doc.DocumentNode.SelectSingleNode("//div[@id=\"hislegalList\"]")?.OuterHtml;
                    //历史对外投资 
                    string hisinvest = doc.DocumentNode.SelectSingleNode("//div[@id=\"hisinvest\"]")?.OuterHtml;
                    //历史在外任职 
                    string hispostOffice = doc.DocumentNode.SelectSingleNode("//div[@id=\"hispostOffice\"]")?.OuterHtml;
                    //历史开庭公告 
                    string hiscsalist = doc.DocumentNode.SelectSingleNode("//div[@id=\"hiscsalist\"]")?.OuterHtml;
                    //历史法院公告
                    string hisctalist = doc.DocumentNode.SelectSingleNode("//div[@id=\"hisctalist\"]")?.OuterHtml;
                    //风险信息 - 限制出境
                    string passportbarrierlist = doc.DocumentNode.SelectSingleNode("//div[@id=\"passportbarrierlist\"]")?.OuterHtml;
                    //菜单
                    string tab = doc.DocumentNode.SelectSingleNode("//div[@class=\"company-nav\"]")?.OuterHtml;

                    var reobject = new
                    {
                        peopledetail = peopledetail,
                        partnerlist = partnerlist,
                        hislegalList = hislegalList,
                        hisinvest = hisinvest,
                        hispostOffice = hispostOffice,
                        hiscsalist = hiscsalist,
                        hisctalist = hisctalist,
                        passportbarrierlist = passportbarrierlist,
                        tab = tab,
                        allHTML= doc.DocumentNode.SelectSingleNode("//div[@class=\"container m-t-md\"]")?.OuterHtml
                };

                    string value = JsonConvert.SerializeObject(reobject);
                    if (!string.IsNullOrWhiteSpace(peopledetail.LegalRepName) || !string.IsNullOrWhiteSpace(partnerlist) || !string.IsNullOrWhiteSpace(hislegalList) || !string.IsNullOrWhiteSpace(hisinvest) ||
                        !string.IsNullOrWhiteSpace(hispostOffice) || !string.IsNullOrWhiteSpace(hiscsalist) || !string.IsNullOrWhiteSpace(hisctalist) || !string.IsNullOrWhiteSpace(passportbarrierlist))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion


        #region 关联企业
        #region 关联企业 - 担任法定代表人
        [Route("people_getinfos_legal")]
        public IActionResult people_getinfos_legal([FromQuery]  string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_legal" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/people_getinfos?p=1&personid=pdd3325c48473fcd64180921d82ead80&box=legal
                    string url = $"https://www.qcc.com/people_getinfos?p={p}&personid={personid}&box=legal";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 关联企业 - 对外投资
        [Route("people_getinfos_invest")]
        public IActionResult people_getinfos_invest([FromQuery]  string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_invest" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=2&personid=pdd3325c48473fcd64180921d82ead80&box=invest
                    string url = $"https://www.qcc.com/people_getinfos?p={p}&personid={personid}&box=invest";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 关联企业 - 在外任职
        [Route("people_getinfos_postoffice")]
        public IActionResult people_getinfos_postoffice([FromQuery]  string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_postoffice" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=2&personid=pdd3325c48473fcd64180921d82ead80&box=postoffice
                    string url = $"https://www.qcc.com/people_getinfos?p={p}&personid={personid}&box=postoffice";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 关联企业 - 他的所有企业
        [Route("people_getinfos_allcompany")]
        public IActionResult people_getinfos_allcompany([FromQuery]  string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_allcompany" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=1&personid=p3483c261f318de061fb3ded0508bf90&box=allcompany
                    string url = $"https://www.qcc.com/people_getinfos?p={p}&personid={personid}&box=allcompany";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 关联企业 - 控制企业
        [Route("people_getinfos_holdco")]
        public IActionResult people_getinfos_holdco([FromQuery] string holdprovince, string holdindustry, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_holdco" + holdprovince + holdindustry + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?holdprovince=BJ&holdindustry=M&personid=p3483c261f318de061fb3ded0508bf90&box=holdco&p=1
                    string url = $"https://www.qcc.com/people_getinfos?holdprovince={holdprovince}&holdindustry={holdindustry}&personid={personid}&box=holdco&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 关联企业 - 间接持股企业
        [Route("people_getinfos_indirectinvestment")]
        public IActionResult people_getinfos_indirectinvestment([FromQuery]  string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_indirectinvestment" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=2&personid=pdd3325c48473fcd64180921d82ead80&box=indirectinvestment
                    string url = $"https://www.qcc.com/people_getinfos?p={p}&personid={personid}&box=indirectinvestment";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 关联企业 - 数据分析
        #endregion
        #region 关联企业 - 所属集团
        [Route("people_getinfos_pergroup")]
        public IActionResult people_getinfos_pergroup([FromQuery] string pgrole, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_pergroup" + pgrole + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?pgrole=2&personid=pdd3325c48473fcd64180921d82ead80&box=pergroup&p=1
                    string url = $"https://www.qcc.com/people_getinfos?pgrole={pgrole}&personid={personid}&box=pergroup&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #endregion

        #region 查查图谱
        #region 查查图谱 - 关系图谱
        [Route("company_muhouInsertIndex")]
        public IActionResult company_muhouInsertIndex([FromQuery] string personid, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_muhouInsertIndex" + personid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_muhouInsertIndex?keyNo=pc197d3d56e76e36d9e38df4f559b257&startLabel=Person
                    string url = $"https://www.qcc.com/company_muhouInsertIndex?keyNo={personid}&startLabel=Person";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, personid);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);
                return Json(data);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 查查图谱 - 股权穿透图
        [Route("cms_guquanperson")]
        public IActionResult cms_guquanperson([FromQuery] string personid, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_guquanperson" + personid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/cms_guquanperson?keyNo=pc197d3d56e76e36d9e38df4f559b257
                    string url = $"https://www.qcc.com/cms_guquanperson?keyNo={personid}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, personid);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html) && ResultModel.Html.ToLower().Replace(" ","").Contains("\"status\":200")) {RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }

        [Route("cms_guquanmapinvestment")]
        public IActionResult cms_guquanmapinvestment([FromQuery] string keyNo, bool iscache = true)
        {
            try
            {
                string Cachekey = "cms_guquanmapinvestment" + keyNo;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/cms_guquanmapinvestment?level=1&keyNo=84c17a005a759a5e0d875c1ebb6c9846
                    string url = $"https://www.qcc.com/cms_guquanmapinvestment?level=1&keyNo={keyNo}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(keyNo))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel ResultModel = serviceControl.HttpGet(url, keyNo);

                    if (!string.IsNullOrWhiteSpace(ResultModel.Html)) { RedisHelpers.HashSet(Cachekey, "default", ResultModel.Html, new TimeSpan(2, 0, 0, 0)); }
                    CacheValue = ResultModel.Html;
                }

                JObject data = JObject.Parse(CacheValue);

                return Json(data);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }




        #endregion
        #endregion
        #region 风险信息
        #region 风险信息 - 司法案件
        [Route("people_getinfos_case")]
        public IActionResult people_getinfos_case([FromQuery] string caseltype, string caselreason, string caselround, string caselTag, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_case" + caseltype + caselreason + caselround + caselTag + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/people_getinfos?caseltype=6&caselreason=证券纠纷案件执行&caselround=首次执行&caselTag=2&personid=p3483c261f318de061fb3ded0508bf90&name=贾跃亭&box=case&p=1
                    string url = $"https://www.qcc.com/people_getinfos?caseltype={caseltype}&caselreason={caselreason}&caselround={caselround}&caselTag={caselTag}&personid={personid}&name=a&box=case&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 被执行人
        [Route("people_getinfos_zhixing")]
        public IActionResult people_getinfos_zhixing([FromQuery] string personid, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_zhixing" + personid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?personid=p3483c261f318de061fb3ded0508bf90&box=zhixing
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=zhixing";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 失信信息
        [Route("people_getinfos_shixin")]
        public IActionResult people_getinfos_shixin([FromQuery] string personid,int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_shixin" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?personid=p3483c261f318de061fb3ded0508bf90&box=shixin&p=1
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=shixin&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 限制高消费
        
        [Route("people_getinfos_sumptuary")]
        public IActionResult people_getinfos_sumptuary([FromQuery] string sumtype,string sumcourtyear, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_sumptuary" + sumtype + sumcourtyear + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?sumtype=main&sumcourtyear=2020&personid=p3483c261f318de061fb3ded0508bf90&box=sumptuary&p=1
                    string url = $"https://www.qcc.com/people_getinfos?sumtype={sumtype}&sumcourtyear={sumcourtyear}&personid={personid}&box=sumptuary&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 限制出境

        //[Route("people_getinfos_passportbarrier")]
        //public IActionResult people_getinfos_passportbarrier([FromQuery] string personid, int p = 1)
        //{
        //    try
        //    {
                
        //        string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=passportbarrier&p={p}";

        //        JObject jobj = new JObject();
        //        jobj.Add(new JProperty("success", true));

        //        if (string.IsNullOrWhiteSpace(personid))
        //        {
        //            jobj["success"] = false;
        //            jobj.Add(new JProperty("message", "缺少参数！"));
        //            return Json(jobj);
        //        }

        //        ServiceControl serviceControl = new ServiceControl();

        //        ResultModel ResultModel = serviceControl.HttpGet(url, personid);
        //        HtmlDocument doc = new HtmlDocument();
        //        doc.OptionAutoCloseOnEnd = true;
        //        doc.LoadHtml(ResultModel.Html);
        //        doc = CommonClass.HelperHtmlNode(doc);
        //        return Content(CacheValue);;
        //    }
        //    catch (Exception ex)
        //    {

        //        return Json(new { success = false, message = ex.Message + ex.StackTrace });
        //    }
        //}
        #endregion
        #region 风险信息 - 终本案件

        [Route("people_getinfos_endexecution")]
        public IActionResult people_getinfos_endexecution([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_endexecution" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=2&personid=p3483c261f318de061fb3ded0508bf90&box=endexecution
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=endexecution&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 股权出质 
        [Route("people_getinfos_pledge")]
        public IActionResult people_getinfos_pledge([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_pledge" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=1&personid=pdd3325c48473fcd64180921d82ead80&box=pledge
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=pledge&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 股权质押
        [Route("people_getinfos_spledge")]
        public IActionResult people_getinfos_spledge([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_spledge" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {


                    //https://www.qcc.com/people_getinfos?p=2&personid=p3483c261f318de061fb3ded0508bf90&box=spledge
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=spledge&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 股权冻结
        [Route("people_getinfos_assistance")]
        public IActionResult people_getinfos_assistance([FromQuery] string asstype, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_assistance" + asstype + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?asstype=executed&personid=p3483c261f318de061fb3ded0508bf90&box=assistance&p=1
                    string url = $"https://www.qcc.com/people_getinfos?asstype={asstype}&personid={personid}&box=assistance&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 开庭公告
        [Route("people_getinfos_notice")]
        public IActionResult people_getinfos_notice([FromQuery] string nttype,string ntcasereason, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_notice" + nttype + ntcasereason + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?nttype=defendant&ntcasereason=%E5%80%9F%E6%AC%BE%E5%90%88%E5%90%8C%E7%BA%A0%E7%BA%B7&personid=p3483c261f318de061fb3ded0508bf90&box=notice&p=1
                    string url = $"https://www.qcc.com/people_getinfos?nttype={nttype}&ntcasereason={ntcasereason}&personid={personid}&box=notice&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 法院公告
        [Route("people_getinfos_gonggao")]
        public IActionResult people_getinfos_gonggao([FromQuery] string ggparticipant, string ggcasereason,string ggcasetype,string ggcourtyear, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_gonggao" + ggparticipant + ggcasereason + ggcasetype + ggcourtyear + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?ggparticipant=d&ggcasereason=%E5%80%9F%E6%AC%BE%E5%90%88%E5%90%8C%E7%BA%A0%E7%BA%B7&ggcasetype=%E6%8B%8D%E5%8D%96%E5%85%AC%E5%91%8A&ggcourtyear=2019&personid=p3483c261f318de061fb3ded0508bf90&box=gonggao&p=1
                    string url = $"https://www.qcc.com/people_getinfos?ggparticipant={ggparticipant}&ggcasereason={ggcasereason}&ggcasetype={ggcasetype}&ggcourtyear={ggcourtyear}&personid={personid}&box=gonggao&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 诉前调解 
        #endregion
        #region 风险信息 - 立案信息
        [Route("people_getinfos_lian")]
        public IActionResult people_getinfos_lian([FromQuery] string latype, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_lian" + latype + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/people_getinfos?latype=appellor&personid=p3483c261f318de061fb3ded0508bf90&box=lian&p=1
                    string url = $"https://www.qcc.com/people_getinfos?latype={latype}&personid={personid}&box=lian&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 裁判文书
        [Route("people_getinfos_wenshu")]
        public IActionResult people_getinfos_wenshu([FromQuery] string casereason,string wsparticipant,string wssubmityear,string wscourtlevel,string wscasetype,string wstrialround,string wsdoctype, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_wenshu" + casereason + wsparticipant + wssubmityear + wscourtlevel + wscasetype + wstrialround + wsdoctype + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?casereason=C0214&wsparticipant=d&wssubmityear=&wscourtlevel=&wscasetype=&wstrialround=&wsdoctype=&personid=p3483c261f318de061fb3ded0508bf90&box=wenshu&p=1
                    string url = $"https://www.qcc.com/people_getinfos?casereason={casereason}&wsparticipant={wsparticipant}&wssubmityear={wssubmityear}&wscourtlevel={wscourtlevel}&wscasetype={wscasetype}&wstrialround={wstrialround}&wsdoctype={wsdoctype}&personid={personid}&box=wenshu&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 风险信息 - 送达公告 
        #endregion
        #region 风险信息 - 询价评估
        #endregion
        #region 风险信息 - 行政处罚
        #endregion
        #region 风险信息 - 违规处理
        [Route("people_getinfos_weigui")]
        public IActionResult people_getinfos_weigui([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_weigui" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=1&personid=p3483c261f318de061fb3ded0508bf90&box=weigui
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=weigui&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #endregion
        #region 合作伙伴
        #region 合作伙伴 - 合作伙伴 base
        // partnerlist
        #endregion
        #endregion
        #region 新闻舆情
        #region 新闻舆情 - 舆情分析

        #endregion
        #region 新闻舆情 - 新闻舆情
        [Route("people_getinfos_news")]
        public IActionResult people_getinfos_news([FromQuery] string newstags, string newsimpact, string newstime, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_news" + newstags + newsimpact + newstime + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?box=news&newstags=10001&newsimpact=none&newstime=&personid=p3483c261f318de061fb3ded0508bf90&p=1
                    string url = $"https://www.qcc.com/people_getinfos?box=news&newstags={newstags}&newsimpact={newsimpact}&newstime={newstime}&personid={personid}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 新闻舆情 - 上榜榜单
        [Route("people_getinfos_sbbd")]
        public IActionResult people_getinfos_sbbd([FromQuery] string bdpublishyear, string bdtype, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "people_getinfos_sbbd" + bdpublishyear + bdtype + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?box=sbbd&bdpublishyear=2019&bdtype=%E4%BA%BA%E7%89%A9&personid=p3483c261f318de061fb3ded0508bf90&p=1
                    string url = $"https://www.qcc.com/people_getinfos?box=sbbd&bdpublishyear={bdpublishyear}&bdtype={bdtype}&personid={personid}&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #endregion
        #region 历史信息
        #region 历史信息 - 历史担任法定代表人
        //base hislegalList
        #endregion
        #region 历史信息 - 历史对外投资
        //base hisinvest
        #endregion
        #region 历史信息 - 历史在外任职
        //base hispostOffice
        #endregion
        #region 历史信息 - 历史被执行人
        [Route("company_getinfos_hiszhixing")]
        public IActionResult company_getinfos_hiszhixing([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hiszhixing" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=1&personid=p3483c261f318de061fb3ded0508bf90&box=hiszhixing
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=hiszhixing&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史失信信息
        [Route("company_getinfos_hisshixin")]
        public IActionResult company_getinfos_hisshixin([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hisshixin" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=1&personid=p3483c261f318de061fb3ded0508bf90&box=hisshixin
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=hisshixin&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史限制高消费
        [Route("company_getinfos_hissumptuary")]
        public IActionResult company_getinfos_hissumptuary([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hissumptuary" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?p=1&personid=p3483c261f318de061fb3ded0508bf90&box=hisshixin
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=hissumptuary&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史股权出质
        [Route("company_getinfos_hispledge")]
        public IActionResult company_getinfos_hispledge([FromQuery] string hispletype,string hisplestatus, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hispledge" + hispletype + hisplestatus + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?hispletype=pledgor&hisplestatus=&personid=p3483c261f318de061fb3ded0508bf90&box=hispledge&p=1
                    string url = $"https://www.qcc.com/people_getinfos?hispletype={hispletype}&hisplestatus={hisplestatus}&personid={personid}&box=hispledge&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史股权冻结
        [Route("company_getinfos_hisassistance")]
        public IActionResult company_getinfos_hisassistance([FromQuery] string hisasstype, string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hisassistance" + hisasstype + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?hisasstype=executed&personid=p3483c261f318de061fb3ded0508bf90&box=hisassistance&p=1
                    string url = $"https://www.qcc.com/people_getinfos?hisasstype={hisasstype}&personid={personid}&box=hisassistance&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史开庭公告 
        //base hiscsalist
        #endregion
        #region 历史信息 - 历史法院公告
        //base hisctalist
        #endregion
        #region 历史信息 - 历史终本案件
        [Route("company_getinfos_hisendexecution")]
        public IActionResult company_getinfos_hisendexecution([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hisendexecution" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/people_getinfos?personid=p3483c261f318de061fb3ded0508bf90&box=hisendexecution&p=1
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=hisendexecution&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史裁判文书 
        [Route("company_getinfos_hisjudgement")]
        public IActionResult company_getinfos_hisjudgement([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hisjudgement" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=hisjudgement&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 历史信息 - 历史送达公告
        [Route("company_getinfos_hisdnotice")]
        public IActionResult company_getinfos_hisdnotice([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos_hisdnotice" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //
                    string url = $"https://www.qcc.com/people_getinfos?personid={personid}&box=hisdnotice&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #endregion








        #endregion



        #endregion

        #region  老赖
        #region  输入框模糊匹配
        [Route("more_deadbeatlist_mind")]
        public IActionResult more_deadbeatlist_mind([FromQuery] string key, string code, bool iscache = true)
        {
            try
            {
                string Cachekey = "more_deadbeatlist_mind" + key + code;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/more_deadbeatlist?type=mind&key=%E7%BD%97%E4%BC%9F&code=&ajax=1&pageSize=10
                    string url = $"https://www.qcc.com/more_deadbeatlist?type=mind&key={key}&code={code}&ajax=1&pageSize=10";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, key);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region  老赖 - 列表
        [Route("more_deadbeatlist")]
        public IActionResult more_deadbeatlist([FromQuery] string key,string code,string type,string province,string publishyear,string birthyear,string sex, bool iscache = true)
        {
            try
            {
                string Cachekey = "more_deadbeatlist" + key + code + type + province + publishyear + birthyear + sex;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/more_deadbeatlist?key=温建华&code=510223198110130319&type=1&province=GD&publishyear=2020&birthyear=2000&sex=%E7%94%B7
                    string url = $"https://www.qcc.com/more_deadbeatlist?key={key}&code={code}&type={type}&province={province}&publishyear={publishyear}&birthyear={birthyear}&sex={sex}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key) && string.IsNullOrWhiteSpace(code))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, key);

                    deadbeatlist deadbeatlist = new deadbeatlist();
                    GroupItem GroupItem;
                    HtmlNodeCollection GroupItemNodes = doc.DocumentNode.SelectNodes("//div[@class=\"pills\"]");
                    if (GroupItemNodes != null)
                    {
                        foreach (var item in GroupItemNodes)
                        {
                            string Grouptype = item.SelectSingleNode(".//div[@class=\"pills-header\"]")?.InnerText.Trim();
                            GroupItem = new GroupItem();
                            if (Grouptype.Contains("查找范围"))
                            {
                                GroupItem.key = "type";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    string src = itema.Attributes["href"]?.Value;
                                    Item.value = CommonClass.GetUrlParam(src, "type");
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("省份地区"))
                            {
                                GroupItem.key = "province";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    string src = itema.Attributes["href"]?.Value;
                                    Item.value = CommonClass.GetUrlParam(src, "province");
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("发布日期"))
                            {
                                GroupItem.key = "publishyear";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    string src = itema.Attributes["href"]?.Value;
                                    Item.value = CommonClass.GetUrlParam(src, "publishyear");
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("出生年份"))
                            {
                                GroupItem.key = "birthyear";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    string src = itema.Attributes["href"]?.Value;
                                    Item.value = CommonClass.GetUrlParam(src, "birthyear");
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            else if (Grouptype.Contains("性别"))
                            {
                                GroupItem.key = "sex";
                                List<Item> Items = new List<Item>();
                                Item Item;
                                HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                foreach (var itema in ItemNodes)
                                {
                                    Item = new Item();
                                    Item.desc = itema?.InnerText.Trim();
                                    string src = itema.Attributes["href"]?.Value;
                                    Item.value = CommonClass.GetUrlParam(src, "sex");
                                    Items.Add(Item);
                                }
                                GroupItem.Items = Items;
                            }
                            if (!string.IsNullOrWhiteSpace(GroupItem.key))
                            {
                                deadbeatlist.GroupItems.Add(GroupItem);
                            }
                        }
                    }

                    var PageIndex = doc.DocumentNode.SelectSingleNode("//ul[@class=\"pagination\"]/li[@class=\"current active\"]")?.InnerText;

                    if (PageIndex != null)
                    {
                        deadbeatlist.Paging.PageIndex = Convert.ToInt32(Regex.Replace(PageIndex, @"[^0-9]+", ""));
                    }
                    else
                    {
                        deadbeatlist.Paging.PageIndex = 0;
                    }
                    var TotalRecords = doc.DocumentNode.SelectSingleNode("//div[@id=\"ajaxlist\"]/div[contains(@class,\"m_search_head\")]//span[@class=\"text-danger\"]")?.InnerText;
                    if (TotalRecords != null)
                    {
                        deadbeatlist.Paging.TotalRecords = Convert.ToInt32(Regex.Replace(TotalRecords, @"[^0-9]+", ""));
                    }
                    deadbeatlist.Paging.PageSize = 20;

                    HtmlNodeCollection m_srchListNodestr = doc.DocumentNode.SelectNodes("//section[@id=\"searchlist\"]//tr");
                    peopledetail peopledetail;
                    if (m_srchListNodestr != null)
                    {
                        foreach (var item in m_srchListNodestr)
                        {
                            peopledetail = new peopledetail();
                            peopledetail.LegalRepImg = item.SelectSingleNode(".//td[1]/img")?.Attributes["src"]?.Value;
                            peopledetail.LegalRepName = item.SelectSingleNode(".//td[2]/a")?.InnerText.Trim();
                            string tempid = item.SelectSingleNode(".//td[2]/a")?.Attributes["href"]?.Value;
                            peopledetail.LegalRepId = tempid.Substring(tempid.IndexOf("keyNo=") + 6, tempid.IndexOf("&name") - tempid.IndexOf("keyNo=") - 6);
                            peopledetail.TagList = item.SelectNodes(".//td[2]/div[@class=\"search-tags\"]/span").Select(p => p.InnerText).ToList();
                            peopledetail.code = item.SelectNodes(".//td[2]/div[@class=\"mchead\"]/p")?.Where(p => p.InnerText.Contains("身份证号码")).Select(p => p.InnerText).FirstOrDefault();
                            peopledetail.Area = item.SelectSingleNode(".//td[3]")?.InnerText.Trim();
                            peopledetail.Intruduce = item.SelectNodes(".//td[2]/div[@class=\"mchead\"]/p")?.Where(p => p.InnerText.Contains("简介")).Select(p => p.InnerText).FirstOrDefault();
                            deadbeat deadbeat;
                            HtmlNodeCollection s_shixin_0s = doc.DocumentNode.SelectNodes("//div[@id=\"s_shixin_0\"]/a");
                            if (s_shixin_0s != null)
                            {
                                foreach (var itemshixin in s_shixin_0s)
                                {
                                    //string deadbeatid = itemshixin.Attributes["onclick"]?.Value;
                                    //if (deadbeatid != null && deadbeatid.Contains("shixin") && deadbeatid.Contains("zhugeTrack"))
                                    //{
                                    //    deadbeat.deadbeatid = deadbeatid.Substring(deadbeatid.IndexOf("'shixin','") + 10, deadbeatid.IndexOf("');zhugeTrack") - deadbeatid.IndexOf("'shixin','") - 10);
                                    //}
                                    //else
                                    //{
                                    //    continue;
                                    //}
                                    if (itemshixin.InnerText.Contains("查看全部失信记录"))
                                    {
                                        continue;
                                    }
                                    deadbeat = new deadbeat();
                                    deadbeat.deadbeatdate = itemshixin.SelectSingleNode(".//span[1]")?.InnerText.Trim();
                                    deadbeat.deadbeatcode = itemshixin.SelectSingleNode(".//span[3]")?.InnerText.Trim();
                                    deadbeat.deadbeatjudgement = itemshixin.SelectSingleNode(".//span[5]")?.InnerText.Trim();
                                    deadbeat.deadbeatresult = itemshixin.SelectSingleNode(".//span[7]")?.InnerText.Trim();
                                    deadbeat.type = "当前失信";
                                    if (deadbeat.deadbeatcode != null)
                                    {
                                        peopledetail.deadbeat.Add(deadbeat);
                                    }
                                }
                            }

                            HtmlNodeCollection s_hisshixin_0 = doc.DocumentNode.SelectNodes("//div[@id=\"s_hisshixin_0\"]/a");
                            if (s_hisshixin_0 != null)
                            {
                                foreach (var itemhisshixin in s_hisshixin_0)
                                {
                                    //string deadbeatid = itemhisshixin.Attributes["onclick"]?.Value;
                                    //if (deadbeatid != null && deadbeatid.Contains("shixin") && deadbeatid.Contains("zhugeTrack"))
                                    //{
                                    //    deadbeat.deadbeatid = deadbeatid.Substring(deadbeatid.IndexOf("'shixin','") + 10, deadbeatid.IndexOf("');zhugeTrack") - deadbeatid.IndexOf("'shixin','") - 10);
                                    //}
                                    //else
                                    //{
                                    //    continue;
                                    //}
                                    if (itemhisshixin.InnerText.Contains("查看全部失信记录"))
                                    {
                                        continue;
                                    }
                                    deadbeat = new deadbeat();
                                    deadbeat.deadbeatdate = itemhisshixin.SelectSingleNode(".//span[1]")?.InnerText.Trim();
                                    deadbeat.deadbeatcode = itemhisshixin.SelectSingleNode(".//span[3]")?.InnerText.Trim();
                                    deadbeat.deadbeatjudgement = itemhisshixin.SelectSingleNode(".//span[5]")?.InnerText.Trim();
                                    deadbeat.deadbeatresult = itemhisshixin.SelectSingleNode(".//span[7]")?.InnerText.Trim();
                                    deadbeat.type = "历史失信";
                                    if (deadbeat.deadbeatcode != null)
                                    {
                                        peopledetail.hisdeadbeat.Add(deadbeat);
                                    }
                                }
                            }

                            deadbeatlist.Result.Add(peopledetail);
                        }
                    }
                    string value = JsonConvert.SerializeObject(deadbeatlist);
                    if (deadbeatlist.Paging.TotalRecords > 0)
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region  明细
        

        [Route("deadbeat")]
        public IActionResult deadbeat([FromQuery] string personid, bool iscache = true)
        {
            try
            {
                string Cachekey = "deadbeat" + personid;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/deadbeat/a5caedcda93c7de058451c6c4701d32e.html
                    string url = $"https://www.qcc.com/deadbeat/{personid}.html";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);

                    peopledetail peopledetail = new peopledetail();
                    peopledetail.LegalRepId = personid;
                    peopledetail.LegalRepImg = doc.DocumentNode.SelectSingleNode("//div[@id=\"company-top\"]//div[@class=\"logo\"]//img")?.Attributes["src"]?.Value.Trim();
                    peopledetail.LegalRepName = doc.DocumentNode.SelectSingleNode("//div[@id=\"company-top\"]//div[@class=\"content\"]/div[@class=\"title\"]/text()")?.InnerText.Trim();
                    peopledetail.TagList = doc.DocumentNode.SelectNodes("//div[@id=\"company-top\"]//div[@class=\"row tags\"]/span/text()")?.Where(p => !string.IsNullOrWhiteSpace(p.InnerText.Replace(" ", ""))).Select(p => p.InnerText).ToList();
                    peopledetail.code = doc.DocumentNode.SelectSingleNode("//div[@class=\"dcontent\"]/div[2]/span[1]")?.InnerText.Trim();
                    peopledetail.Intruduce = doc.DocumentNode.SelectSingleNode("//div[@class=\"dcontent\"]/div[2]/span[2]")?.InnerText.Trim();
                    peopledetail.Area = doc.DocumentNode.SelectSingleNode("//div[@class=\"dcontent\"]/div[2]/span[3]")?.InnerText.Trim();

                    HtmlNodeCollection aa = doc.DocumentNode.SelectNodes("//a");
                    foreach (var item in aa)
                    {
                        string herf = item.Attributes["href"]?.Value;
                        if (herf != null)
                        {
                            if (herf.Contains("pl.html?"))
                            {
                                ///pl/p3483c261f318de061fb3ded0508bf90.html
                                peopledetail.PersonId = herf.Substring(herf.IndexOf("keyNo=") + 6, herf.IndexOf("&name=") - herf.IndexOf("keyNo=") - 6);
                            }
                        }
                    }

                    var reobject = new
                    {
                        peopledetail = peopledetail,
                    };

                    string value = JsonConvert.SerializeObject(reobject);
                    if (!string.IsNullOrWhiteSpace(peopledetail.LegalRepName))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }

        //失信记录
        [Route("more_getDeadShixinList")]
        public IActionResult more_getDeadShixinList([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "more_getDeadShixinList" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/more_getDeadShixinList?p=1&id=a5caedcda93c7de058451c6c4701d32e&dtype=sx
                    string url = $"https://www.qcc.com/more_getDeadShixinList?p={p}&id={personid}&dtype=sx";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }
                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }

        //历史失信记录
        [Route("more_getDeadShixinList_hissx")]
        public IActionResult more_getDeadShixinList_hissx([FromQuery] string personid, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "more_getDeadShixinList_hissx" + personid  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/more_getDeadShixinList?p=2&id=0ee2cb5f569561a7dfa7f894da84039c&dtype=hissx
                    string url = $"https://www.qcc.com/more_getDeadShixinList?p={p}&id={personid}&dtype=hissx";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(personid))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, personid);
                     if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText)){RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));}
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);;
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }


        [Route("company_shixinRelat")]
        public IActionResult company_shixinRelat([FromQuery] string id, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_shixinRelat" + id;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_shixinRelat?id=a4bb40d46ab717b7cded12083febc43a2&isValid=
                    string url = $"https://www.qcc.com/company_shixinRelat?id={id}&isValid=";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(id))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();

                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, id);
                    HtmlNodeCollection ids = doc.DocumentNode.SelectNodes("//tr");
                    string aa = "";
                    if (ids != null)
                    {
                        foreach (var item in ids)
                        {
                            string name = item.SelectSingleNode(".//td[1]")?.InnerText;
                            if (name.Contains("案号"))
                            {
                                string tempaa = item.SelectSingleNode(".//td[2]/a")?.Attributes["href"]?.Value;
                                aa = tempaa.Substring(tempaa.IndexOf("keyNo=") + 6, tempaa.IndexOf("&name=") - tempaa.IndexOf("keyNo=") - 6);
                                break;
                            }
                            else
                            {
                                continue;
                            }
                        }
                    }

                    //https://www.qcc.com/more_caserelatlist?ids=d3369cf4fe2f87aa42d5f04dbf80f3cc&isNew=
                    string url2 = $"https://www.qcc.com/more_caserelatlist?ids={aa}&isNew=";
                    JObject jobj2 = new JObject();
                    jobj2.Add(new JProperty("success", true));
                    HtmlDocument doc2 = serviceControl.HttpGetAndDocOP(url2, id);

                    var returnobj = new
                    {
                        company_shixinRelat = doc.DocumentNode.OuterHtml,
                        more_caserelatlist = doc2.DocumentNode.OuterHtml
                    };

                    string value = JsonConvert.SerializeObject(returnobj);
                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.OuterHtml) || !string.IsNullOrWhiteSpace(doc2.DocumentNode.OuterHtml))
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }

        #endregion
        #endregion

        #region  知识产权
        #region 知识产权 - 商标
        [Route("bigsearch_assetslist")]
        public IActionResult bigsearch_assetslist([FromQuery] string key,string searchType,string flowStatus,string intcls,string appdateyear, int p=1, bool iscache = true)
        {
            try
            {
                string Cachekey = "bigsearch_assetslist" + key + searchType + flowStatus + intcls + appdateyear  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/bigsearch_assetslist?key=%E5%9B%BA%E8%BE%BE&searchType=intelligent&flowStatus=8&intcls=1&appdateyear=2019&ajax=true
                    string url = $"https://www.qcc.com/bigsearch_assetslist?key={key}&searchType={searchType}&flowStatus={flowStatus}&intcls={intcls}&appdateyear={appdateyear}&p={p}&ajax=true";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }
                    bigsearch_assets bigsearch_assets = new bigsearch_assets();

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel resultmodel = serviceControl.HttpGet(url, key);
                    JObject jObject = JObject.Parse(resultmodel.Html);

                    if (jObject["filter"] != null)
                    {
                        HtmlDocument docfilter = new HtmlDocument();
                        docfilter.LoadHtml(jObject["filter"]?.ToString());

                        GroupItem GroupItem;
                        HtmlNodeCollection GroupItemNodes = docfilter.DocumentNode.SelectNodes("/div");
                        if (GroupItemNodes != null)
                        {
                            foreach (var item in GroupItemNodes)
                            {
                                string Grouptype = item.SelectSingleNode(".//div[@class=\"pills-header\"]")?.InnerText.Trim();
                                GroupItem = new GroupItem();
                                if (Grouptype.Contains("查询方式"))
                                {
                                    GroupItem.key = "searchType";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('searchType','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }
                                else if (Grouptype.Contains("商标状态"))
                                {
                                    GroupItem.key = "flowStatus";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('flowStatus','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }
                                else if (Grouptype.Contains("国际分类"))
                                {
                                    GroupItem.key = "intcls";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('intcls','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }
                                else if (Grouptype.Contains("申请日期"))
                                {
                                    GroupItem.key = "appdateyear";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('appdateyear','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }

                                if (!string.IsNullOrWhiteSpace(GroupItem.key))
                                {
                                    bigsearch_assets.GroupItems.Add(GroupItem);
                                }
                            }
                        }
                    }

                    if (jObject["list"] != null)
                    {
                        HtmlDocument doclist = new HtmlDocument();
                        doclist.LoadHtml(jObject["list"]?.ToString());


                        var PageIndex = doclist.DocumentNode.SelectSingleNode("//ul[contains(@class,\"pagination\")]/li[contains(@class,\"active\")]")?.InnerText;

                        if (PageIndex != null)
                        {
                            bigsearch_assets.Paging.PageIndex = Convert.ToInt32(Regex.Replace(PageIndex, @"[^0-9]+", ""));
                        }
                        else
                        {
                            bigsearch_assets.Paging.PageIndex = 0;
                        }
                        var TotalRecords = doclist.DocumentNode.SelectSingleNode("/div[1]//span[@class=\"text-danger\"]")?.InnerText;
                        if (TotalRecords != null)
                        {
                            bigsearch_assets.Paging.TotalRecords = Convert.ToInt32(Regex.Replace(TotalRecords, @"[^0-9]+", ""));
                        }
                        bigsearch_assets.Paging.PageSize = 20;
                        HtmlNodeCollection m_srchListNodestr = doclist.DocumentNode.SelectNodes("//tr");
                        brand brand;
                        if (m_srchListNodestr != null)
                        {
                            foreach (var item in m_srchListNodestr)
                            {
                                brand = new brand();
                                brand.brandId = item.SelectSingleNode(".//td[2]/div/a")?.Attributes["href"]?.Value.Replace("/brandDetail/", "").Replace(".html", "");
                                brand.brandName = item.SelectSingleNode(".//td[2]/div/a")?.InnerText.Trim();
                                brand.brandImg = item.SelectSingleNode(".//td[1]//img")?.Attributes["src"]?.Value;
                                brand.brandtype = item.SelectSingleNode(".//td[2]/div/div/div[1]/span[3]")?.InnerText.Trim();
                                brand.code = item.SelectSingleNode(".//td[2]/div/div/div[1]/span[1]")?.InnerText.Trim();
                                brand.date = item.SelectSingleNode(".//td[2]/div/div/div[1]/span[2]")?.InnerText.Trim();
                                brand.queryId = item.SelectSingleNode(".//td[2]/div/div/div[2]/span[1]//a")?.Attributes["keyno"]?.Value;
                                brand.queryName = item.SelectSingleNode(".//td[2]/div/div/div[2]/span[1]")?.InnerText.Trim();
                                brand.status = item.SelectSingleNode(".//td[3]")?.InnerText.Trim();
                                if (!string.IsNullOrWhiteSpace(brand.brandName))
                                {
                                    bigsearch_assets.brands.Add(brand);
                                }
                            }
                        }
                    }

                    string value = JsonConvert.SerializeObject(bigsearch_assets);
                    if (bigsearch_assets.Paging.TotalRecords > 0)
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 知识产权 - 专利
        [Route("bigsearch_assetslist_zhuanli")]
        public IActionResult bigsearch_assetslist_zhuanli([FromQuery] string key, string kindcode, string status, string publicationyear, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "bigsearch_assetslist_zhuanli" + key + kindcode + status + publicationyear  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/bigsearch_assetslist?key=%E4%BC%81%E6%9F%A5%E6%9F%A5&type=zhuanli&kindcode=A&status=0301&publicationyear=2018&ajax=true
                    string url = $"https://www.qcc.com/bigsearch_assetslist?key={key}&type=zhuanli&kindcode={kindcode}&status={status}&publicationyear={publicationyear}&ajax=true&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }
                    bigsearch_assets bigsearch_assets = new bigsearch_assets();

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel resultmodel = serviceControl.HttpGet(url, key);
                    JObject jObject = JObject.Parse(resultmodel.Html);
                    if (jObject["filter"] != null)
                    {
                        HtmlDocument docfilter = new HtmlDocument();
                        docfilter.LoadHtml(jObject["filter"]?.ToString());

                        GroupItem GroupItem;
                        HtmlNodeCollection GroupItemNodes = docfilter.DocumentNode.SelectNodes("/div");
                        if (GroupItemNodes != null)
                        {
                            foreach (var item in GroupItemNodes)
                            {
                                string Grouptype = item.SelectSingleNode(".//div[@class=\"pills-header\"]")?.InnerText.Trim();
                                GroupItem = new GroupItem();
                                if (Grouptype.Contains("专利类型"))
                                {
                                    GroupItem.key = "kindcode";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('kindcode','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }
                                else if (Grouptype.Contains("法律状态"))
                                {
                                    GroupItem.key = "status";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('status','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }
                                else if (Grouptype.Contains("公开年份"))
                                {
                                    GroupItem.key = "publicationyear";
                                    List<Item> Items = new List<Item>();
                                    Item Item;
                                    HtmlNodeCollection ItemNodes = item.SelectNodes(".//div[@class=\"pills-after\"]/a[@class=\"pills-item\"]");
                                    foreach (var itema in ItemNodes)
                                    {
                                        Item = new Item();
                                        Item.desc = itema?.InnerText.Trim();
                                        Item.value = itema.Attributes["onclick"]?.Value.Replace("bigSearchFilter('publicationyear','", "").Replace("')", "");
                                        Items.Add(Item);
                                    }
                                    GroupItem.Items = Items;
                                }

                                if (!string.IsNullOrWhiteSpace(GroupItem.key))
                                {
                                    bigsearch_assets.GroupItems.Add(GroupItem);
                                }
                            }
                        }

                    }

                    if (jObject["list"] != null)
                    {
                        HtmlDocument doclist = new HtmlDocument();
                        doclist.LoadHtml(jObject["list"]?.ToString());


                        var PageIndex = doclist.DocumentNode.SelectSingleNode("//ul[contains(@class,\"pagination\")]/li[contains(@class,\"active\")]")?.InnerText;

                        if (PageIndex != null)
                        {
                            bigsearch_assets.Paging.PageIndex = Convert.ToInt32(Regex.Replace(PageIndex, @"[^0-9]+", ""));
                        }
                        else
                        {
                            bigsearch_assets.Paging.PageIndex = 0;
                        }
                        var TotalRecords = doclist.DocumentNode.SelectSingleNode("/div//span[@class=\"text-danger\"]")?.InnerText;
                        if (TotalRecords != null)
                        {
                            bigsearch_assets.Paging.TotalRecords = Convert.ToInt32(Regex.Replace(TotalRecords, @"[^0-9]+", ""));
                        }
                        bigsearch_assets.Paging.PageSize = 20;
                        HtmlNodeCollection m_srchListNodestr = doclist.DocumentNode.SelectNodes("//tr");
                        patent patent;
                        if (m_srchListNodestr != null)
                        {
                            foreach (var item in m_srchListNodestr)
                            {
                                patent = new patent();
                                patent.patentImg = item.SelectSingleNode(".//td[1]//img")?.Attributes["src"]?.Value;
                                patent.patentId = item.SelectSingleNode(".//td[2]/div/a")?.Attributes["href"]?.Value.Replace("/zhuanliDetail/", "").Replace(".html", "");
                                patent.patentName = item.SelectSingleNode(".//td[2]/div/a")?.InnerText.Trim();
                                patent.TagList = item.SelectNodes(".//td[2]/div/div[@class=\"tags\"]/span")?.Select(p => p.InnerText).ToList();
                                patent.inventor = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[1]/span[3]")?.InnerText.Trim();
                                patent.type = item.SelectSingleNode(".//td[3]")?.InnerText.Trim();
                                patent.Intruduce = null;
                                patent.querycode = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[2]/span[1]")?.InnerText.Trim();
                                patent.code = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[1]/span[1]")?.InnerText.Trim();
                                patent.date = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[1]/span[2]")?.InnerText.Trim();
                                patent.postdate = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[2]/span[2]")?.InnerText.Trim();
                                patent.queryId = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[3]/span[1]//a")?.Attributes["keyno"]?.Value;
                                patent.queryName = item.SelectSingleNode(".//td[2]/div/div[@class=\"relate-info\"]/div[3]/span[1]")?.InnerText.Trim();
                                if (!string.IsNullOrWhiteSpace(patent.patentName))
                                {
                                    bigsearch_assets.patents.Add(patent);
                                }
                            }
                        }
                    }
                    string value = JsonConvert.SerializeObject(bigsearch_assets);
                    if (bigsearch_assets.Paging.TotalRecords > 0)
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 知识产权 - 软件著作权
        [Route("bigsearch_assetslist_rjzzq")]
        public IActionResult bigsearch_assetslist_rjzzq([FromQuery] string key, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "bigsearch_assetslist_rjzzq" + key  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/bigsearch_assetslist?key=%E4%BC%81%E6%9F%A5%E6%9F%A5&type=rjzzq&p=2&ajax=true
                    string url = $"https://www.qcc.com/bigsearch_assetslist?key={key}&type=rjzzq&ajax=true&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    bigsearch_assets bigsearch_assets = new bigsearch_assets();

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel resultmodel = serviceControl.HttpGet(url, key);
                    JObject jObject = JObject.Parse(resultmodel.Html);

                    if (jObject["list"] != null)
                    {
                        HtmlDocument doclist = new HtmlDocument();
                        doclist.LoadHtml(jObject["list"]?.ToString());

                        var PageIndex = doclist.DocumentNode.SelectSingleNode("//ul[contains(@class,\"pagination\")]/li[contains(@class,\"active\")]")?.InnerText;

                        if (PageIndex != null)
                        {
                            bigsearch_assets.Paging.PageIndex = Convert.ToInt32(Regex.Replace(PageIndex, @"[^0-9]+", ""));
                        }
                        else
                        {
                            bigsearch_assets.Paging.PageIndex = 0;
                        }
                        var TotalRecords = doclist.DocumentNode.SelectSingleNode("/div//span[@class=\"text-danger\"]")?.InnerText;
                        if (TotalRecords != null)
                        {
                            bigsearch_assets.Paging.TotalRecords = Convert.ToInt32(Regex.Replace(TotalRecords, @"[^0-9]+", ""));
                        }
                        bigsearch_assets.Paging.PageSize = 20;
                        HtmlNodeCollection m_srchListNodestr = doclist.DocumentNode.SelectNodes("//tr");
                        rjzzq rjzzq;
                        if (m_srchListNodestr != null)
                        {
                            foreach (var item in m_srchListNodestr)
                            {
                                rjzzq = new rjzzq();
                                rjzzq.rjzzqName = item.SelectSingleNode(".//td[1]/div/div[1]")?.InnerText.Trim();
                                rjzzq.rjzzqShortName = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[1]")?.InnerText.Trim();
                                rjzzq.code = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[3]")?.InnerText.Trim();
                                rjzzq.date = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[2]")?.InnerText.Trim();
                                rjzzq.queryId = item.SelectSingleNode(".//td[1]/div/div[2]/div[2]//a")?.Attributes["keyno"]?.Value;
                                rjzzq.queryName = item.SelectSingleNode(".//td[1]/div/div[2]/div[2]")?.InnerText.Trim();
                                if (!string.IsNullOrWhiteSpace(rjzzq.rjzzqName))
                                {
                                    bigsearch_assets.rjzzqs.Add(rjzzq);
                                }
                            }
                        }
                    }

                    string value = JsonConvert.SerializeObject(bigsearch_assets);
                    if (bigsearch_assets.Paging.TotalRecords > 0)
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion
        #region 知识产权 - 作品著作权
        [Route("bigsearch_assetslist_zzq")]
        public IActionResult bigsearch_assetslist_zzq([FromQuery] string key, int p = 1, bool iscache = true)
        {
            try
            {
                string Cachekey = "bigsearch_assetslist_zzq" + key  + p.ToString();
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {

                    //https://www.qcc.com/bigsearch_assetslist?key=%E4%BC%81%E6%9F%A5%E6%9F%A5&type=zzq&p=1&ajax=true
                    string url = $"https://www.qcc.com/bigsearch_assetslist?key={key}&type=zzq&ajax=true&p={p}";

                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(key))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    bigsearch_assets bigsearch_assets = new bigsearch_assets();

                    ServiceControl serviceControl = new ServiceControl();

                    ResultModel resultmodel = serviceControl.HttpGet(url, key);
                    JObject jObject = JObject.Parse(resultmodel.Html);

                    if (jObject["list"] != null)
                    {
                        HtmlDocument doclist = new HtmlDocument();
                        doclist.LoadHtml(jObject["list"]?.ToString());

                        var PageIndex = doclist.DocumentNode.SelectSingleNode("//ul[contains(@class,\"pagination\")]/li[contains(@class,\"active\")]")?.InnerText;

                        if (PageIndex != null)
                        {
                            bigsearch_assets.Paging.PageIndex = Convert.ToInt32(Regex.Replace(PageIndex, @"[^0-9]+", ""));
                        }
                        else
                        {
                            bigsearch_assets.Paging.PageIndex = 0;
                        }
                        var TotalRecords = doclist.DocumentNode.SelectSingleNode("/div//span[@class=\"text-danger\"]")?.InnerText;
                        if (TotalRecords != null)
                        {
                            bigsearch_assets.Paging.TotalRecords = Convert.ToInt32(Regex.Replace(TotalRecords, @"[^0-9]+", ""));
                        }
                        bigsearch_assets.Paging.PageSize = 20;
                        HtmlNodeCollection m_srchListNodestr = doclist.DocumentNode.SelectNodes("//tr");
                        zpzzq zpzzq;
                        if (m_srchListNodestr != null)
                        {
                            foreach (var item in m_srchListNodestr)
                            {
                                zpzzq = new zpzzq();
                                zpzzq.zpzzqName = item.SelectSingleNode(".//td[1]/div/div[1]")?.InnerText.Trim();
                                zpzzq.type = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[1]")?.InnerText.Trim();
                                zpzzq.code = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[4]")?.InnerText.Trim();
                                zpzzq.date1 = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[2]")?.InnerText.Trim();
                                zpzzq.date2 = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[3]")?.InnerText.Trim();
                                zpzzq.date3 = item.SelectSingleNode(".//td[1]/div/div[2]/div[1]/span[5]")?.InnerText.Trim();
                                zpzzq.queryId = item.SelectSingleNode(".//td[1]/div/div[2]/div[2]//a")?.Attributes["keyno"]?.Value;
                                zpzzq.queryName = item.SelectSingleNode(".//td[1]/div/div[2]/div[2]")?.InnerText.Trim();
                                if (!string.IsNullOrWhiteSpace(zpzzq.zpzzqName))
                                {
                                    bigsearch_assets.zpzzqs.Add(zpzzq);
                                }
                            }
                        }
                    }


                    string value = JsonConvert.SerializeObject(bigsearch_assets);
                    if (bigsearch_assets.Paging.TotalRecords > 0)
                    {
                        RedisHelpers.HashSet(Cachekey, "default", value, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = value;

                }

                var CacheObjec = JsonConvert.DeserializeObject<object>(CacheValue);
                return Json(CacheObjec);
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);

                return Json(new { success = false, message = ex.Message + ex.StackTrace });
            }
        }
        #endregion



        #endregion

        [Route("company_getinfos")]
        public IActionResult company_getinfos(string unique,string tab, bool iscache = true)
        {
            try
            {
                string Cachekey = "company_getinfos" + unique + tab;
                string CacheValue = RedisHelpers.HashGet(Cachekey, "default");
                if (string.IsNullOrWhiteSpace(CacheValue) || !iscache)
                {
                    //https://www.qcc.com/company_getinfos?unique=f1c5372005e04ba99175d5fd3db7b8fc&companyname=a&tab=susong
                    string url = $"https://www.qcc.com/company_getinfos?unique={unique}&companyname=a&tab={tab}";
                    JObject jobj = new JObject();
                    jobj.Add(new JProperty("success", true));

                    if (string.IsNullOrWhiteSpace(unique) || string.IsNullOrWhiteSpace(tab))
                    {
                        jobj["success"] = false;
                        jobj.Add(new JProperty("message", "缺少参数！"));
                        return Json(jobj);
                    }

                    ServiceControl serviceControl = new ServiceControl();
                    HtmlDocument doc = serviceControl.HttpGetAndDocOP(url, unique);

                    if (tab == "base")
                    {
                        string cwsj = "<section class=\"panel clear b-a\" id=\"cwsj\">" +
    "   <div class=\"tcaption\">" +
        "   <h3 class=\"title\">财务数据</h3> <span class=\"tbadge\">10</span>" +
        "<div class=\"tdrop\"> <span class=\"btn\"" +
            "       onclick=\"exportTable(this,'财务数据',213);zhugeTrack('导出数据来源',{'企业主页':'财务数据'});\"> <span" +
            "       class=\"export\"></span> <span>导出数据</span> </span> </div>" +
            "</div>" +
            "  <div id=\"newindicatorlist\"> " +
                " </div>" +
                " <div id=\"newincomelist\">" +
                    " </div>" +
                    "  <div id=\"newbalancelist\"> " +
                        "  </div>" +
                        "  <div id=\"newcashflowlist\">" +
                            "  </div>" +
                            "</section>";
                        HtmlDocument doccwsj = new HtmlDocument();
                        doccwsj.LoadHtml(cwsj);
                        doc.DocumentNode.AppendChild(doccwsj.DocumentNode);

                        HtmlNode m_ptsc = doc.DocumentNode.SelectSingleNode("//div[@class=\"m_ptsc\"]");
                        if (m_ptsc != null)
                        {
                            m_ptsc.ParentNode.Remove();
                            doc.DocumentNode.AppendChild(m_ptsc.ParentNode);
                        }
                        


                        HtmlNode divpartnerscharts = doc.DocumentNode.SelectSingleNode("//div[@id=\"partnerschart\"]");
                        if (divpartnerscharts != null)
                        {
                            HtmlNode divpartnerschartsnext = divpartnerscharts.NextSibling.NextSibling;
                            if (divpartnerschartsnext != null)
                            {
                                divpartnerschartsnext.Remove();
                            }
                            divpartnerscharts.Remove();
                        }

                        HtmlNode touziprovinces = doc.DocumentNode.SelectSingleNode("//div[@id=\"touzi-province\"]");
                        if (touziprovinces != null)
                        {
                            HtmlNode divpartnerschartsnext = touziprovinces.ParentNode.ParentNode.ParentNode;
                            if (divpartnerschartsnext != null)
                            {
                                divpartnerschartsnext.Remove();
                            }
                        }


                        
                    }

                    if (tab == "susong")
                    {
                        HtmlNode caseAnalysisTable = doc.DocumentNode.SelectSingleNode("//table[@id=\"caseAnalysisTable\"]");
                        if (caseAnalysisTable != null)
                        {
                            HtmlNode spledgeTrendChartP = caseAnalysisTable.ParentNode;
                            if (spledgeTrendChartP != null)
                            {
                                spledgeTrendChartP.Remove();
                            }
                        }
                    }

                    if (tab == "assets")
                    {
                        HtmlNodeCollection sections = doc.DocumentNode.SelectNodes("//section");
                        if (sections != null)
                        {
                            for (int i = 0; i < sections.Count; i++)
                            {

                                HtmlNodeCollection subsections = sections[i].SelectNodes(".//section");
                                if (subsections != null)
                                {
                                    for (int j = 0; j < subsections.Count; j++)
                                    {
                                        subsections[j].Remove();
                                    }
                                }
                                sections[i].Remove();
                                doc.DocumentNode.AppendChild(sections[i]);
                            }
                        }
                        HtmlNode m_ptsc = doc.DocumentNode.SelectSingleNode("//div[@class=\"m_ptsc\"]");
                        if (m_ptsc != null)
                        {
                            m_ptsc.ParentNode.Remove();
                            doc.DocumentNode.AppendChild(m_ptsc.ParentNode);
                        }
                       

                        HtmlNode spledgeTrendChart = doc.DocumentNode.SelectSingleNode("//div[@id=\"shangbiao-year-chart\"]");
                        if (spledgeTrendChart != null)
                        {
                            HtmlNode spledgeTrendChartP = spledgeTrendChart.ParentNode.ParentNode.ParentNode;
                            if (spledgeTrendChartP != null)
                            {
                                spledgeTrendChartP.Remove();
                            }
                        }
                        HtmlNode zlAnalysisTable = doc.DocumentNode.SelectSingleNode("//table[@id=\"zlAnalysisTable\"]");
                        if (zlAnalysisTable != null)
                        {
                            HtmlNode spledgeTrendChartP = zlAnalysisTable.ParentNode.ParentNode;
                            if (spledgeTrendChartP != null)
                            {
                                spledgeTrendChartP.Remove();
                            }
                        }
                        HtmlNode zhengshuyearchart = doc.DocumentNode.SelectSingleNode("//table[@id=\"zhengshu-year-chart\"]");
                        if (zhengshuyearchart != null)
                        {
                            HtmlNode spledgeTrendChartP = zhengshuyearchart.ParentNode.ParentNode.ParentNode.ParentNode;
                            if (spledgeTrendChartP != null)
                            {
                                spledgeTrendChartP.Remove();
                            }
                        }
                        
                    }

                    if (tab == "fengxian")
                    {
                        HtmlNodeCollection riskgraphs = doc.DocumentNode.SelectNodes("//section[@id=\"scRiskInfo\"]/div[@class=\"tcaption\"] | //section[@id=\"ctRiskInfo\"]/div[@class=\"tcaption\"]");
                        if (riskgraphs != null)
                        {
                            for (int i = 0; i < riskgraphs.Count; i++)
                            {
                                riskgraphs[i].Remove();
                            }
                        }
                        HtmlNode spledgeTrendChart = doc.DocumentNode.SelectSingleNode("//div[@id=\"spledgeTrendChart\"]");
                        if (spledgeTrendChart != null)
                        {
                            HtmlNode spledgeTrendChartP = spledgeTrendChart.ParentNode.ParentNode;
                            if (spledgeTrendChartP != null)
                            {
                                spledgeTrendChartP.Remove();
                            }
                        }
                    }

                    if (tab == "run")
                    {
                        HtmlNode spledgeTrendChart = doc.DocumentNode.SelectSingleNode("//div[@id=\"PieSal\"]");
                        if (spledgeTrendChart != null)
                        {
                            HtmlNode spledgeTrendChartP = spledgeTrendChart.ParentNode.ParentNode.ParentNode;
                            if (spledgeTrendChartP != null)
                            {
                                spledgeTrendChartP.Remove();
                            }
                        }
                    }

                    if (!string.IsNullOrWhiteSpace(doc.DocumentNode.InnerText) )
                    {
                        RedisHelpers.HashSet(Cachekey, "default", doc.DocumentNode.OuterHtml, new TimeSpan(2, 0, 0, 0));
                    }
                    CacheValue = doc.DocumentNode.OuterHtml;
                }

                return Content(CacheValue);

            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex.Message + ex.StackTrace);
                return Json(new { success = false, message = ex.ToString() });
            }

        }



    }
}
